getType() публичный Метод

public getType ( ) : string
Результат string
 public function getDeleteRelationshipQuery($entityIdA, $entityIdB, RelationshipMetadata $relationship)
 {
     $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}
     MATCH (a)' . $relStringPart . '(b)
     DELETE r';
     return Statement::create($query, ['ida' => $entityIdA, 'idb' => $entityIdB]);
 }
Пример #2
0
 public function persistRelationship($entityA, $entityB, RelationshipMetadata $relationship, array &$visited)
 {
     if ($entityB instanceof Collection || $entityB instanceof ArrayCollection) {
         foreach ($entityB as $e) {
             $aMeta = $this->entityManager->getClassMetadataFor(get_class($entityA));
             $bMeta = $this->entityManager->getClassMetadataFor(get_class($entityB));
             $type = $relationship->isRelationshipEntity() ? $this->entityManager->getRelationshipEntityMetadata($relationship->getRelationshipEntityClass())->getType() : $relationship->getType();
             $hashStr = $aMeta->getIdValue($entityA) . $bMeta->getIdValue($entityB) . $type . $relationship->getDirection();
             $hash = md5($hashStr);
             if (!array_key_exists($hash, $this->relationshipsScheduledForCreated)) {
                 $this->relationshipsScheduledForCreated[] = [$entityA, $relationship, $e, $relationship->getPropertyName()];
             }
             $this->doPersist($e, $visited);
         }
         return;
     }
     $this->doPersist($entityB, $visited);
     $this->relationshipsScheduledForCreated[] = [$entityA, $relationship, $entityB, $relationship->getPropertyName()];
 }