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

getSource() public method

Get source class name
public getSource ( ) : string
return string
    public function getSource()
    {
        return $this->source;
    }

Usage Example

Example #1
0
 /**
  * Delete all references created by this relationship
  *
  * @param Relationship    $relationship Forward relationship
  * @param object|object[] $value        Forward relationship value
  * @param string          $local_id     ID of local entity
  * @internal param string $key Forward relationship key
  */
 private function deleteRelationshipRefs(Relationship $relationship, $value, $local_id)
 {
     $ref = new Ref($relationship->getSource(), $local_id, $relationship->getName());
     if (!is_array($value)) {
         $value = [$value];
     }
     foreach ($value as $foreign_entity) {
         if (null !== $foreign_entity) {
             $foreign_id = $this->getEntityId($foreign_entity);
             $ref_key = $this->getKeyScheme()->getEntityRefKey($this->getTargetTable($relationship), $foreign_id);
             $this->getDriver()->removeRef($ref_key, $ref);
         }
     }
 }
All Usage Examples Of Bravo3\Orm\Mappers\Metadata\Relationship::getSource