protected function getOpposingRelationName($model) { if (!$this->opposingRelationNameRetrieved) { if (null !== ($opposingRelationName = RedBeanModel::getHasManyOpposingRelationName($model, $this->relatedModelClassName, $this->relatedAttributeName))) { $this->opposingRelationName = $opposingRelationName; } $this->opposingRelationNameRetrieved = true; } return $this->opposingRelationName; }