public function __construct() { parent::__construct(); $this->viewInfo['add']['template'] = 'form'; $this->viewInfo['add']['title'] = "Add {$this->modelType}"; $this->viewInfo['admin']['title'] = "{$this->modelType} Admin"; $this->viewInfo['admin']['description'] = "{$this->modelType} Admin on " . DOMAIN . '.'; $this->viewInfo['edit']['template'] = 'form'; $this->viewInfo['edit']['title'] = "Edit {$this->modelType}"; $this->viewInfo['index']['title'] = "{$this->modelType}s"; $this->viewInfo['index']['description'] = "{$this->modelType}s on " . DOMAIN . '.'; $this->viewInfo['page']['template'] = 'index'; $this->viewInfo['page']['title'] = "{$this->modelType}s - Page {PageNumber}"; $this->viewInfo['save']['title'] = "Save {$this->modelType}"; $this->viewInfo['view']['title'] = $this->modelType; $this->viewInfo['view']['description'] = "{$this->modelType} on " . DOMAIN . '.'; $this->viewInfo['view']['canonicalURL'] = PROTOCOL_HOST_PORT . "{$this->pathInURL}/view/{ID}"; if (!is_subclass_of($this->modelType, '\\CWA\\MVC\\Models\\DatabaseRecord')) { throw new InvalidArgumentException("{$this->modelType} does not inherit from DatabaseRecord.", 500); } $this->db = $this->app->getDatabase(); if (!isset($this->indexSort)) { $class = $this->modelType; $this->indexSort = $class::getUpdatedFieldName(); if (is_null($this->indexSort)) { $this->indexSort = $class::getCreatedFieldName(); } if (is_null($this->indexSort)) { $this->indexSort = $class::getAlternateKeyName(); } $this->indexSort .= ' DESC'; } if (!isset($this->indexLimit)) { $this->indexLimit = 10; } if (!isset($this->indexClauses)) { $this->indexClauses = "ORDER BY {$this->indexSort}"; } if (!isset($this->pageLimit)) { // pageLimit defaults to the indexLimit. -- cwells $this->pageLimit = $this->indexLimit; } if (!isset($this->adminSort)) { $class = $this->modelType; $this->adminSort = $class::getAlternateKeyName(); if (is_null($this->adminSort)) { $this->adminSort = $class::getPrimaryKeyName(); } } if (!isset($this->adminLimit)) { $this->adminLimit = 25; } }
public function __construct() { parent::__construct(); $this->viewInfo['view']['title'] = 'Error'; $this->viewInfo['view']['description'] = 'Error'; }