Mongolid\ActiveRecord::execute PHP Method

execute() protected method

Performs the given action into database.
protected execute ( string $action ) : boolean
$action string Datamapper function to execute.
return boolean
    protected function execute(string $action)
    {
        if (!$this->getCollectionName()) {
            return false;
        }
        $options = ['writeConcern' => new WriteConcern($this->getWriteConcern())];
        if ($result = $this->getDataMapper()->{$action}($this, $options)) {
            $this->syncOriginalAttributes();
        }
        return $result;
    }