Пример #1
0
 public function getRelationByObject(myModel $object)
 {
     return Relationship::query()->where('start_id = :start:', ['start' => $object->id])->andWhere('start_type = :start_type:', ['start_type' => get_class($this)])->andWhere('end_id = :end:', ['end' => $this->id])->andWhere('end_type = :end_type:', ['end_type' => get_class($this)])->execute()->getFirst();
 }