Bolt\Storage\Field\Type\RelationType::getExistingRelations PHP Метод

getExistingRelations() защищенный Метод

Get existing relationship records.
protected getExistingRelations ( mixed $entity ) : array
$entity mixed
Результат array
    protected function getExistingRelations($entity)
    {
        $query = $this->em->createQueryBuilder()->select('*')->from($this->mapping['target'])->where('from_id = :from_id')->andWhere('from_contenttype = :from_contenttype')->andWhere('to_contenttype = :to_contenttype')->setParameters(['from_id' => $entity->id, 'from_contenttype' => $entity->getContenttype(), 'to_contenttype' => $this->mapping['fieldname']]);
        $result = $query->execute()->fetchAll();
        return $result ?: [];
    }