LazyRecord\BaseCollection::create PHP Метод

create() публичный Метод

Create new record or relationship record, and append the record into _rows list.
public create ( array $args ) : mixed
$args array Arguments for creating record
Результат mixed record object
    public function create(array $args)
    {
        if ($this->_presetVars) {
            $args = array_merge($this->_presetVars, $args);
        }
        // model record
        $record = $this->getSchema()->newModel();
        $return = $record->create($args);
        if ($return->success) {
            if ($this->_postCreate) {
                $middleRecord = call_user_func($this->_postCreate, $record, $args);
                // $this->_postCreate($record,$args);
            }
            $this->_rows[] = $record;
            return $record;
        }
        $this->_result = $return;
        return false;
    }