Example #1
0
 /**
  * @param FileAbstraction $file
  * @param string $propertyName
  * @return FileProperty
  * @throws Exception\RuntimeException
  */
 public function getFileCustomProperty(FileAbstraction $file, $propertyName)
 {
     if (!isset($this->customPropertyConfigurations[$propertyName])) {
         throw new Exception\RuntimeException("Property '{$propertyName}' is not configured");
     }
     $property = $file->getCustomProperties()->get($propertyName);
     /* @var $property FileProperty */
     if (!$property instanceof FileProperty) {
         $property = new FileProperty($propertyName, $file);
         $this->getDoctrineEntityManager()->persist($property);
     }
     return $property;
 }