add() публичный Метод

This function lets you make the statement "$guid_one is a $relationship of $guid_two". In the statement, $guid_one is the subject of the relationship, $guid_two is the target, and $relationship is the type.
public add ( integer $guid_one, string $relationship, integer $guid_two, boolean $return_id = false ) : boolean | integer
$guid_one integer GUID of the subject entity of the relationship
$relationship string Type of the relationship
$guid_two integer GUID of the target entity of the relationship
$return_id boolean Return the ID instead of bool?
Результат boolean | integer
Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function add($guid_one, $relationship, $guid_two, $return_id = false)
 {
     $rel = $this->check($guid_one, $relationship, $guid_two);
     if ($rel) {
         return false;
     }
     $this->iterator++;
     $id = $this->iterator;
     $row = (object) ['id' => $id, 'guid_one' => (int) $guid_one, 'guid_two' => (int) $guid_two, 'relationship' => $relationship, 'time_created' => $this->getCurrentTime()->getTimestamp()];
     $this->rows[$id] = $row;
     $this->addQuerySpecs($row);
     return parent::add($row->guid_one, $row->relationship, $row->guid_two, $return_id);
 }