/** * Builds one or more classes based on the build definition * @param boolean $allowCustomize */ public function build($allowCustomize) { $classes = $this->createBuildDefinition($allowCustomize); foreach ($classes as $def) { $targetFolder = $this->createTargetFolder($def); $targetFile = "{$targetFolder}/{$def['className']}.php"; $def['appNamespace'] = $this->applicationNamespace; $def['classFQRN'] = $this->relation->getFQRN(); render_php_template($this->template, $this->preparBuildDefinition($def), $targetFile, false); } }
/** * Check if the Relation needs to be customized later * @param Relation $relation * @return type */ private function allowCustomize(Relation $relation) { $customizedModels = $this->config->getCustomizedRelationList(); if (!is_array($customizedModels)) { $customizedModels = []; } return in_array($relation->getName(), $customizedModels) || in_array($relation->getFQRN(), $customizedModels); }