public static function create($collection, $id = null, $database = null)
    {
        if ($collection instanceof \Phalcon\Mvc\Collection) {
            $id = $collection->getId();
            $collection = $collection->getSource();
        }
        if ($id instanceof \Phalcon\Mvc\Collection) {
            $id = $id->getId();
        }
        if (!$id instanceof \MongoId && $id !== null) {
            $id = new \MongoId($id);
        }

        return parent::create($collection, $id, $database);
    }
public static function create($collection, $id = null, $database = null)
    {
        if ($collection instanceof \Phalcon\Mvc\Collection) {
            $id = $collection->getId();
            $collection = $collection->getSource();
        }
        if ($id instanceof \Phalcon\Mvc\Collection) {
            $id = $id->getId();
        }
        if (!$id instanceof \MongoId && $id !== null) {
            $id = new \MongoId($id);
        }

        return parent::create($collection, $id, $database);
    }
public static function create ( $ collection , $ id = null , $ database = null ) { if ( $ collection instanceof \ Phalcon \ Mvc \ Collection ) { $ id = $ collection -> getId ( ) ; $ collection = $ collection -> getSource ( ) ; } if ( $ id instanceof \ Phalcon \ Mvc \ Collection ) { $ id = $ id -> getId ( ) ; } if ( ! $ id instanceof \ MongoId && $ id !== null ) { $ id = new \ MongoId ( $ id ) ; } return parent :: create ( $ collection , $ id , $ database ) ; }
Creates a new database reference

@param string|\Phalcon\Mvc\Collection $collection
@param mixed|\MongoId|\Phalcon\Mvc\Collection $id
@param string $database
@return array
Creates a new database reference