public static function getInstance() { if (!self::$instance) { self::$instance = new StateDAO(); } return self::$instance; }
/** * Override default validation * @see Phreezable::Validate() */ public function Validate() { // example of custom validation // $this->ResetValidationErrors(); // $errors = $this->GetValidationErrors(); // if ($error == true) $this->AddValidationError('FieldName', 'Error Information'); // return !$this->HasValidationErrors(); return parent::Validate(); }
function getStateList() { self::openConn(); try { $stateList = StateDAO::readStateList($this->con); } catch (PDOException $e) { /* guarantees db con close */ $stateList = NULL; } self::closeConn(); return $stateList; }