public function addComment($val)
{
$this->comment .= $this->comment ? "\n{$val}" : $val;
return $this;
}
private function createModel() { $class = new ClassType('Orm', $this->namespace); $class->setExtends('\\Nextras\\Orm\\Model\\Model'); foreach ($this->parsedSql as $block) { if (isset($block['CREATE'], $block['TABLE'])) { $table = $this->normalizeSqlName($block['TABLE']['name']); $type = $this->getCamelCase($table) . "Repository"; $property = '$' . $this->getCamelCase($table, true) . 's'; $class->addComment("@property-read {$type} {$property}"); } } $this->createClass($class); }