示例#1
0
 public function testToString_withoutSummWithoutBodyWithAnno()
 {
     $docBlock = new DocBlock();
     $docBlock->addAnnotation($m2n = $this->createManyToManyAnnotation('persons'));
     $actual = $docBlock->toString();
     $expected = array('/**', ' * ' . $m2n->toString(), ' */', '');
     $this->assertEquals(implode("\n", $expected), $actual);
 }
示例#2
0
 /**
  * Fügt einem DocBlock die passenden Annotations für die Source Seite der Relation hinzu
  */
 public function addAnnotationsForSource(DocBlock $docBlock)
 {
     extract(Annotation::getClosureHelpers());
     $docBlock->addAnnotation($this->getRelation());
     if ($this->type === self::MANY_TO_MANY && $this->sourceSide !== self::INVERSE) {
         // bei unidirectional brauchen wir natürlich auch einen JoinTable
         $docBlock->addAnnotation($this->getJoinTable());
     }
     if ($this->type === self::MANY_TO_ONE || $this->type === self::ONE_TO_ONE) {
         $docBlock->addAnnotation($this->getJoinColumn());
     }
     if (($this->type === self::MANY_TO_MANY || $this->type === self::ONE_TO_MANY) && isset($this->orderBy)) {
         $docBlock->addAnnotation($this->orderBy);
     }
     foreach ($this->otherAnnotations as $annotation) {
         $docBlock->addAnnotation($annotation);
     }
 }