Prado\Data\ActiveRecord\Scaffold\TScaffoldBase::getRecordObject PHP Метод

getRecordObject() защищенный Метод

Gets the current Active Record instance. Creates new instance if the primary key value is null otherwise the record is fetched from the db.
protected getRecordObject ( $pk = null ) : TActiveRecord
Результат Prado\Data\ActiveRecord\TActiveRecord record instance
    protected function getRecordObject($pk = null)
    {
        if ($this->_record === null) {
            if ($pk !== null) {
                $this->_record = $this->getRecordFinder()->findByPk($pk);
                if ($this->_record === null) {
                    throw new TConfigurationException('scaffold_invalid_record_pk', $this->getRecordClass(), $pk);
                }
            } else {
                $class = $this->getRecordClass();
                if ($class !== null) {
                    $this->_record = Prado::createComponent($class);
                } else {
                    throw new TConfigurationException('scaffold_invalid_record_class', $this->getRecordClass(), $this->getID());
                }
            }
        }
        return $this->_record;
    }