Ejemplo n.º 1
0
 function it_should_tell_if_the_relationship_has_the_specified_property_name(RelationshipProperty $property)
 {
     $property->getName()->willReturn('since');
     $this->addProperty($property);
     $this->hasProperty('since')->shouldReturn(true);
     $this->hasProperty('weight')->shouldReturn(false);
 }
Ejemplo n.º 2
0
 /**
  * Adds a relationship property to the collection and avoid duplicated
  *
  * @param  RelationshipProperty $property
  * @return bool
  */
 public function addProperty(RelationshipProperty $property)
 {
     foreach ($this->properties as $prop) {
         if ($prop->getName() === $property->getName()) {
             $this->properties->removeElement($prop);
         }
     }
     return $this->properties->add($property);
 }