setOwner($owner); $this->setType($type); $this->setName($name); } /** * Transform a database columnname to a property * * @param string $columnName the name of the column * @return string the property name * @todo migrate existing database columns to the correct names * to be able to drop this direct mapping */ public function columnToProperty(string $columnName): string { if ($columnName === 'category') { return 'name'; } if ($columnName === 'uid') { return 'owner'; } return parent::columnToProperty($columnName); } /** * Transform a property to a database column name * * @param string $property the name of the property * @return string the column name */ public function propertyToColumn(string $property): string { if ($property === 'name') { return 'category'; } if ($property === 'owner') { return 'uid'; } return parent::propertyToColumn($property); } }