Phalcon\Mvc\MongoCollection::setId PHP Method

setId() public method

Sets a value for the _id property, creates a MongoId object if needed
public setId ( mixed $id )
$id mixed
    public function setId($id)
    {
        $mongoId = null;
        if (is_object($id)) {
            $mongoId = $id;
        } else {
            if ($this->_modelsManager->isUsingImplicitObjectIds($this)) {
                $mongoId = new ObjectID($id);
            } else {
                $mongoId = $id;
            }
        }
        $this->_id = $mongoId;
    }