src/Neutrino/Repositories/Repository.php
public function firstOrNew(array $params = [], $create = false, $withTransaction = false)
    {
        $model = $this->first($params);

        if ($model === false) {
            $class = $this->modelClass;

            $model = new $class;

            foreach ($params as $key => $param) {
                $model->$key = $param;
            }

            if ($create && $this->create($model, $withTransaction) === false) {
                throw new TransactionException(__METHOD__ . ': can\'t create model : ' . get_class($model));
            };
        }

        return $model;
    }
public function firstOrNew(array $params = [], $create = false, $withTransaction = false)
    {
        $model = $this->first($params);

        if ($model === false) {
            $class = $this->modelClass;

            $model = new $class;

            foreach ($params as $key => $param) {
                $model->$key = $param;
            }

            if ($create && $this->create($model, $withTransaction) === false) {
                throw new TransactionException(__METHOD__ . ': can\'t create model : ' . get_class($model));
            };
        }

        return $model;
    }
@param array $params
@param bool  $create
@param bool  $withTransaction

@return \Neutrino\Model|\Phalcon\Mvc\Model
@throws \Neutrino\Repositories\Exceptions\TransactionException