public function init() { if (empty($this->related_name)) { $this->setOption('related_name', $this->metadata->getDbTableName()); } parent::init(); }