GraphAware\Neo4j\OGM\Metadata\RelationshipMetadata::getPropertyName PHP Method

getPropertyName() public method

public getPropertyName ( ) : string
return string
    public function getPropertyName()
    {
        return $this->propertyName;
    }

Usage Example

 public function getRelationshipQuery($entityIdA, RelationshipMetadata $relationship, $entityIdB)
 {
     if ('' === trim($relationship->getType())) {
         throw new \RuntimeException(sprintf('Cannot create empty relationship type', $relationship->getPropertyName()));
     }
     $relString = '';
     switch ($relationship->getDirection()) {
         case 'OUTGOING':
             $relString = '-[r:%s]->';
             break;
         case 'INCOMING':
             $relString = '<-[r:%s]-';
             break;
         case 'BOTH':
             $relString = '-[r:%s]-';
             break;
         default:
             throw new \InvalidArgumentException(sprintf('Direction "%s" is not valid', $relationship->getDirection()));
     }
     $relStringPart = sprintf($relString, $relationship->getType());
     $query = 'MATCH (a), (b) WHERE id(a) = {ida} AND id(b) = {idb}
     MERGE (a)' . $relStringPart . '(b)
     RETURN id(r)';
     return Statement::create($query, ['ida' => $entityIdA, 'idb' => $entityIdB]);
 }
All Usage Examples Of GraphAware\Neo4j\OGM\Metadata\RelationshipMetadata::getPropertyName