/** * Convert tag to PHP code */ public function toPhp($onAdapter = false) { parent::toPhp($onAdapter); $this->writeSignature(); // START RETURN if (!$this->isEntityRequest()) { if ($this->type == 'select-one') { $this->writeLine('$ret = ' . $this->rqManager); } else { $this->writeLine('return ' . $this->rqManager); } } $this->buildRequest(); if (!$this->isEntityRequest()) { $this->writeLine('->Run();'); if ($this->type == 'select-one') { $this->writeLine('if ($ret && sizeof($ret) == 1) {'); $this->writeLine('return $ret->current();'); $this->writeLine('} else {'); $this->writeLine('return null;'); $this->writeLine('}'); } } $this->writeLine('}'); }
public function toPhp($onAdapter = false) { parent::toPhp($onAdapter); $this->writeLine('public function getter' . $this->name . '() {'); $this->writeLine('if (!$this->' . $this->name . ') {'); $this->writeLine('}'); $this->writeLine('return $this->' . $this->name . ';'); $this->writeLine('}'); }