Наследование: extends Nette\Object, implements Nextras\Orm\Mapper\Dbal\StorageReflection\IStorageReflection
Пример #1
0
 /**
  * @param string   $propertyName
  * @param callable $toEntityTransform
  * @param callable $toSqlTransform
  * @throws InvalidPropertyException
  */
 public function addGenericArrayMapping($propertyName, callable $toEntityTransform, callable $toSqlTransform)
 {
     $this->validateProperty($propertyName);
     $this->storageReflection->addMapping($propertyName, $this->storageReflection->convertEntityToStorageKey($propertyName), function ($value) use($toEntityTransform) {
         return PgArray::parse($value, $toEntityTransform);
     }, function ($value) use($toSqlTransform) {
         return PgArray::serialize($value, $toSqlTransform);
     });
 }