FOF30\Factory\Scaffolding\Model\ModelErector::setSection PHP Метод

setSection() публичный Метод

public setSection ( string $section )
$section string
    public function setSection($section)
    {
        $this->section = $section;
    }

Usage Example

Пример #1
0
 /**
  * Make a new scaffolding document
  *
  * @param   string  $requestedClass     The requested class, with full qualifier ie Myapp\Site\Controller\Foobar
  * @param   string  $viewName           The name of the view linked to this controller
  *
  * @return  bool    True on success, false otherwise
  */
 public function make($requestedClass, $viewName)
 {
     // Class already exists? Stop here
     if (class_exists($requestedClass)) {
         return true;
     }
     // I have to magically create the model class
     $magic = new ModelFactory($this->container);
     $magic->setSection($this->getSection());
     $fofModel = $magic->make($viewName);
     /** @var ErectorInterface $erector */
     $erector = new ModelErector($this, $fofModel, $viewName);
     $erector->setSection($this->getSection());
     $erector->build();
     if (!class_exists($requestedClass)) {
         return false;
     }
     return true;
 }