Bravo3\Orm\Mappers\Metadata\Relationship::setTarget PHP Method

setTarget() public method

Set target class name
public setTarget ( string $target )
$target string
    public function setTarget($target)
    {
        $this->target = $target;
        return $this;
    }

Usage Example

Example #1
0
 /**
  * Create a relationship from schema
  *
  * @param string $property
  * @param array  $column_schema
  * @return Relationship
  */
 private function createRelationship($property, array $column_schema)
 {
     $assoc = $this->getNode($column_schema, Schema::REL_ASSOCIATION, true);
     $relationship = new Relationship($property, RelationshipType::memberByValue($assoc));
     $relationship->setTarget($this->getNode($column_schema, Schema::REL_TARGET, true))->setInversedBy($this->getNode($column_schema, Schema::REL_INVERSED_BY, false))->setGetter($this->getNode($column_schema, Schema::GETTER, false))->setSetter($this->getNode($column_schema, Schema::SETTER, false))->setSortableBy($this->createSortables($column_schema));
     return $relationship;
 }