protected function getReferencingField($table, $name)
    {
        $references = $this->getReferences();
        $rf = null;
        foreach ($references as $item) {
            if ($item->refTable === $table && $table . '_by_' . implode('_', $item->refField) === $name) {
                $rf = $item->refField[0];
                break;
            }
        }

        return $rf;
    }