getSource() public method

Get source class name
public getSource ( ) : string
return string
Esempio n. 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);
         }
     }
 }
Esempio n. 2
0
 /**
  * Get the relationship source table name
  *
  * @param Relationship $relationship
  * @return string
  */
 protected function getSourceTable(Relationship $relationship)
 {
     return $this->getTableForClass($relationship->getSource());
 }