activerow = $activerow; } public function getContext() { # return $this->activerow->getTable()->connection->context; return $this->database->context; } public function getPrimary($need = true) { return $this->activerow->getPrimary($need); } public function getObjectName() { $name = preg_replace('/^App\\\\/', '', $this->reflection->name); return strtr($name, '\\', ':'); } public function getRootDir() { $dir = $this->reflection->fileName; foreach(explode(':', $this->objectName) as $dummy) $dir = dirname($dir); return $dir; } public function getTemplateDir() { $presenter = strtr($this->objectName, ':', '/'); return "$this->rootDir/templates/$presenter"; } }