/** * Given active record class name returns new model instance. * * @param string $className active record class name. * * @return \Database\ActiveRecord\Record active record model instance. * * @since 1.1.14 */ protected function getModel($className) { return \Database\ActiveRecord\Record::model($className); }
/** * Returns the static model of the specified AR class. * Please note that you should have this exact method in all your Record descendants! * @param string $className active record class name. * @return CargoPacking the static model class */ public static function model($className = __CLASS__) { return parent::model($className); }
/** * Compares current active record with another one. * The comparison is made by comparing table name and the primary key values of the two active records. * @param Record $record record to compare to * @return boolean whether the two active records refer to the same row in the database table. */ public function equals($record) { return $this->tableName() === $record->tableName() && $this->getPrimaryKey() === $record->getPrimaryKey(); }