@param                      $property
@param EntityInterface      $entity
@param Repository           $repository
@param ParametersCollection $configuration

@return null
@throws ExtensionException
346230
private function updateEntity($property, EntityInterface $entity, Repository $repository, ParametersCollection $configuration)
    {
        if ($configuration->offsetExists('on') && $onEvent = $configuration->offsetGet('on')) {
            
            $onEvent = !static::isIterable($onEvent) ? [$onEvent] : $onEvent;
            
            foreach ($onEvent as $onEventName) {
                if (($onEventName === Timestampable::ON_CREATE && $repository->isNewEntity($entity)) || $onEventName === Timestampable::ON_UPDATE) {
                    $entity->setByProperty($property, new DateTime());
                }
            }
            
            return null;
        }
        
        throw new ExtensionException('Wrong configuration passed to Timestampable extension');
    }
730691
protected void visitChildProperties(NodeData node) throws RepositoryException
   {
      if (isInterrupted())
         return;
      for (PropertyData data : dataManager.getChildPropertiesData(node))
      {
         if (isInterrupted())
            return;
         data.accept(this);
      }
   }
366059
private function isPropertyAllowedByIntersectProperties(
        PropertyInterface $property,
        EnvironmentInterface $environment
    ) {
        $sessionStorage = $environment->getSessionStorage();
        $inputProvider  = $environment->getInputProvider();
        $dataDefinition = $environment->getDataDefinition();

        $session = $sessionStorage->get($dataDefinition->getName() . '.' . $inputProvider->getParameter('mode'));

        return \array_key_exists($property->getName(), $session['intersectProperties']);
    }
409060
public static CacheEntry forProperty(final Property property) throws RepositoryException {
        // if it's an external binary, catch that here and treat it differently.
        if (property.getName().endsWith(PROXY_FOR.getLocalName()) ||
                property.getName().endsWith(REDIRECTS_TO.getLocalName())) {
            LOGGER.debug("Creating ExternalResourceCacheEntry for property: {} {}", property.getName(),
                    property.getValue().toString());
            return new ExternalResourceCacheEntry(property);
        }

        final Binary binary = property.getBinary();

        if (binary instanceof ExternalBinaryValue) {
           return new ProjectedCacheEntry(property);
        }
        return new BinaryCacheEntry(property);
    }
1285890
protected function addErrorToProperty(string $property, string $key, string $extensionName) {
    $errorMessage = LocalizationUtility::translate($key, $extensionName);
    $error        = $this->objectManager->get(Error::class, $errorMessage, time());

    $this->result->forProperty($property)->addError($error);
  }
24055
protected function setProperty(ReflectionProperty $property)
    {
        if (mb_strpos($property->getDocComment(), Bean::ANNOTATION_PROPERTY, 0, 'UTF-8') !== false) {
            $this->property = $property;
        } else {
            $msg = "The property must be annotated with '@qtism-bean-property'.";
            throw new BeanException($msg, BeanException::NO_ANNOTATION);
        }
    }
1137050
public static function extractValueFromEntity($entity, $property)
    {
        $getter = self::createGetter($entity, $property);

        return $entity->$getter();
    }
1124730
public function addMissingProperty(MetaEntityInterface $metaEntity, RelationMetaPropertyInterface $property)
    {
        $inversedBy = $property->getInversedBy();
        $mappedBy = $property->getMappedBy();
        if ($newPropertyName = $mappedBy ?: $inversedBy) {
            $inversedType = MetaPropertyFactory::getInversedType($property->getOrmType());
            /** @var RelationMetaPropertyInterface $newProperty */
            $newProperty = $this->metaPropertyFactory->createMetaProperty(
                $metaEntity,
                $inversedType,
                $newPropertyName
            );
            $newProperty->setTargetEntity($property->getMetaEntity());
            if ($inversedBy) {
                $newProperty->setMappedBy($property->getName());
            } else {
                $newProperty->setInversedBy($property->getName());
            }
        }
    }
74284
protected function getAuthorProperty(PackageInterface $package, $property)
    {
        if (!$package instanceof CompletePackageInterface) {
            return null;
        }

        $authors = $package->getAuthors();
        if (empty($authors)) {
            return null;
        }

        $firstAuthor = reset($authors);

        if (!isset($firstAuthor[$property])) {
            return null;
        }

        return $firstAuthor[$property];
    }
1037741
public function updateProperty(\ReflectionProperty $reflectionProperty, Schema $property)
    {
        $annotations = $this->annotationsReader->getPropertyAnnotations($reflectionProperty);

        foreach ($annotations as $annotation) {
            if ($annotation instanceof Assert\NotBlank || $annotation instanceof Assert\NotNull) {
                // The field is required
                if (null === $this->schema) {
                    continue;
                }

                $propertyName = $this->getSchemaPropertyName($property);
                if (null === $propertyName) {
                    continue;
                }

                $existingRequiredFields = $this->schema->getRequired() ?? [];
                $existingRequiredFields[] = $propertyName;

                $this->schema->setRequired(array_values(array_unique($existingRequiredFields)));
            } elseif ($annotation instanceof Assert\Length) {
                $property->setMinLength($annotation->min);
                $property->setMaxLength($annotation->max);
            } elseif ($annotation instanceof Assert\Regex) {
                $this->appendPattern($property, $annotation->getHtmlPattern());
            } elseif ($annotation instanceof Assert\Count) {
                $property->setMinItems($annotation->min);
                $property->setMaxItems($annotation->max);
            } elseif ($annotation instanceof Assert\Choice) {
                $property->setEnum($annotation->callback ? call_user_func(is_array($annotation->callback) ? $annotation->callback : [$reflectionProperty->class, $annotation->callback]) : $annotation->choices);
            } elseif ($annotation instanceof Assert\Expression) {
                $this->appendPattern($property, $annotation->message);
            } elseif ($annotation instanceof Assert\Range) {
                $property->setMinimum($annotation->min);
                $property->setMaximum($annotation->max);
            } elseif ($annotation instanceof Assert\LessThan) {
                $property->setExclusiveMaximum($annotation->value);
            } elseif ($annotation instanceof Assert\LessThanOrEqual) {
                $property->setMaximum($annotation->value);
            }
        }
    }
310915
private function getJoin(\ReflectionProperty $property, $type = Join::class, $exception = true)
    {
        /** @var Join|JoinTable $join */
        $join = $this->reader->getPropertyAnnotation($property, $type);
        if ($exception && ($join === null || ! $join instanceof $type)) {
            throw new RelationException("Relation in '".$property->getDeclaringClass()->getName()."' -> '".$property->getName()."' should have @$type annotation!"); // @codeCoverageIgnore
        }
        if ($exception && $type === Join::class && ($join->column === null || $join->targetColumn === null)) {
            throw new RelationException("Join in '".$property->getDeclaringClass()->getName()."' -> '".$property->getName()."' should have the local column and targetColumn filled in!"); // @codeCoverageIgnore
        }
        if ($exception && $type === JoinTable::class && ($join->name == "" || ! $join->column instanceof JoinColumn || ! $join->targetColumn instanceof JoinColumn)) {
            throw new RelationException("JoinTable in '".$property->getDeclaringClass()->getName()."' -> '".$property->getName()."' should have a table name and 2 join columns in column and targetColumn!"); // @codeCoverageIgnore
        }
        return $join;
    }
897133
public static function get($property, $collection)
    {
        if (false === self::isValid($collection)) {
            return [];
        }

        $getter = sprintf('get%s', ucfirst($property));
        $result = [];
        foreach ($collection as $entity) {
            $function = [
                $entity,
                $getter
            ];

            if (false === is_callable($function)) {
                throw new LogicException('Missing getter');
            }

            $result[] = $entity->$getter();
        }

        return $result;
    }
69657
private function configureInheritanceMapping($id, $entity, $repository)
    {
        $entities = [
            $id => [
                'class'      => $entity,
                'repository' => $repository,
            ],
        ];

        if ($this->container->hasParameter('ekyna_core.entities')) {
            $entities = array_merge($this->container->getParameter('ekyna_core.entities'), $entities);
        }
        $this->container->setParameter('ekyna_core.entities', $entities);
    }
1063116
private function isPropertyAllowed(PropertyInterface $property, EnvironmentInterface $environment)
    {
        if (!$property->getWidgetType()
            || ('dummyProperty' === $property->getWidgetType())
        ) {
            return false;
        }

        $translator = $environment->getTranslator();

        $extra = (array) $property->getExtra();
        if ($this->isPropertyAllowedByEdit($extra, $environment)
            || $this->isPropertyAllowedByOverride($extra, $environment)
        ) {
            Message::addInfo(
                \sprintf(
                    $translator->translate('MSC.not_allowed_property_info'),
                    $property->getLabel() ?: $property->getName(),
                    $translator->translate('MSC.' . $environment->getInputProvider()->getParameter('mode') . 'Selected')
                )
            );

            return false;
        }

        return $this->isPropertyAllowedByIntersectProperties($property, $environment);
    }
885220
private function _initMany($property, $method, $mode, $sourcePrimary) {
		$collection = $this->getCollection();
		
		$data = $collection->__call($method);
		if ($data === null) return;

		if ($data instanceof Collection) {
			if ($data->hasMetadata()) {
				$meta = $data->getMetadata();

				$onProperty     = $meta->joinOnProperty;
				$sourceProperty = $meta->joinOnSource;
			} else {
				$onProperty     = null;
				$sourceProperty = null;
			}

			if ($mode === self::MODE_CASCADE) {
				// If not specified in meta, using a requested property
				if ($onProperty === null) {
					$onProperty = $property;
				}

				// If not specified in meta:
				if ($sourceProperty === null) {
					if ($sourcePrimary === null) {
						// Attempt to get from source collection
						$sourceProperty = $data->getPrimary();

						if ($sourceProperty === null) {
							throw new Exception('Unable to determine a source property for join');
						}
					} else {
						// Manually specified
						$sourceProperty = $sourcePrimary;
					}
				}
			}

			if ($mode === self::MODE_JOIN) {
				$collection->join($data, $onProperty, $sourceProperty);
			}
			else if ($mode === self::MODE_CASCADE || $mode === self::MODE_CASCADE_MANY) {
				$collection->setList($onProperty, $data->toArray(), $sourceProperty);
			}
			else {
				throw new Exception('Uncnown loading mode');
			}
		} else {
			throw new Exception('Data must be represented as a collection');
		}
	}
80978
public function load(EntityInterface $entity)
    {
        $adapter = $this->getAdapter();

        $relTable = $this->getParentTableName();
        $relPmk = $this->getParentPrimaryKey();

        $table = $this->getEntityDescriptor()->getTableName();
        $pmk = $this->getEntityDescriptor()->getPrimaryKey();
        $fnk = $this->getForeignKey();

        $onClause = "{$relTable}.{$relPmk} = {$table}.{$fnk}";

        $data = Sql::createSql($adapter)
            ->select($relTable)
            ->join($table, $onClause, null)
            ->where([
                "{$table}.{$pmk->getField()} = :id" => [
                    ':id' => $entity->{$pmk->getName()}
                ]
            ])
            ->first();

        $relEntity = $this->getParentEntityMapper()->createFrom($data);

        return null == $relEntity ? null :$this->registerEntity($relEntity);
    }
983918
private function getEntitySetter($entity, $property)
    {
        $setter = 'set'.ucfirst($property);
        if (!method_exists($entity, $setter)) {
            throw new \LogicException("Entity has no setter for property `{$property}`.");
        }

        return $setter;
    }