示例#1
0
 /**
  * Returns the whole definition in array form
  *
  * @return array Definition
  */
 public function getDefAsArray()
 {
     return array_replace(parent::getDefAsArray(), ['type' => $this->getType(), 'doctrineType' => $this->getTypeDoctrine(), 'serializerType' => $this->getTypeSerializer(), 'relType' => $this->relation === null ? self::REL_TYPE_REF : $this->relation->getType(), 'isClassType' => true]);
 }
示例#2
0
 /**
  * Process parent relation
  *
  * @param Schema\Relation $relation Parent relation
  * @return Schema\Relation|null
  */
 private function processParentRelation(Schema\Relation $relation)
 {
     $prefixRegex = '/^' . preg_quote($this->name, '/') . '\\.(\\d+\\.)*(?P<sub>.*)/';
     if (!preg_match($prefixRegex, $relation->getLocalProperty(), $matches)) {
         return null;
     }
     $clone = clone $relation;
     $clone->setLocalProperty($matches['sub']);
     return $clone;
 }