GraphAware\Neo4j\OGM\Metadata\GraphEntityMetadata::__construct PHP Method

__construct() public method

GraphEntityMetadata constructor.
public __construct ( EntityIdMetadata $entityIdMetadata, string $className, ReflectionClass $reflectionClass, array $entityPropertiesMetadata )
$entityIdMetadata EntityIdMetadata
$className string
$reflectionClass ReflectionClass
$entityPropertiesMetadata array
    public function __construct(EntityIdMetadata $entityIdMetadata, $className, \ReflectionClass $reflectionClass, array $entityPropertiesMetadata)
    {
        $this->entityIdMetadata = $entityIdMetadata;
        $this->className = $className;
        $this->reflectionClass = $reflectionClass;
        foreach ($entityPropertiesMetadata as $meta) {
            if ($meta instanceof EntityPropertyMetadata) {
                $this->entityPropertiesMetadata[$meta->getPropertyName()] = $meta;
            }
        }
    }

Usage Example

 /**
  * RelationshipEntityMetadata constructor.
  *
  * @param string                                               $class
  * @param \ReflectionClass                                     $reflectionClass
  * @param \GraphAware\Neo4j\OGM\Annotations\RelationshipEntity $annotation
  * @param \GraphAware\Neo4j\OGM\Metadata\EntityIdMetadata      $entityIdMetadata
  * @param string                                               $startNodeClass
  * @param string                                               $endNodeClass
  * @param array                                                $entityPropertiesMetadata
  */
 public function __construct($class, \ReflectionClass $reflectionClass, RelationshipEntity $annotation, EntityIdMetadata $entityIdMetadata, $startNodeClass, $startNodeKey, $endNodeClass, $endNodeKey, array $entityPropertiesMetadata)
 {
     parent::__construct($entityIdMetadata, $class, $reflectionClass, $entityPropertiesMetadata);
     $this->relationshipEntityAnnotation = $annotation;
     $this->startNodeEntityMetadata = $startNodeClass;
     $this->endNodeEntityMetadata = $endNodeClass;
     $this->type = $annotation->type;
     $this->startNodeReflectionProperty = $this->reflectionClass->getProperty($startNodeKey);
     $this->endNodeReflectionProperty = $this->reflectionClass->getProperty($endNodeKey);
 }
All Usage Examples Of GraphAware\Neo4j\OGM\Metadata\GraphEntityMetadata::__construct