function processPost($formvalues) { # change the employee type to an array # first check if the employee type value exists in the formvalues, this gives an E_NOTICE warning # for PHP 5 if (isset($formvalues['employeetype'])) { # check if the employee type value is an array if (!is_array($formvalues['employeetype'])) { # Do not add the employee type if its an empty string if (empty($formvalues['employeetype'])) { $formvalues['employeetype'] = array(); } else { $formvalues['employeetype'] = explode(",", $formvalues['employeetype']); } } } parent::processPost($formvalues); }
/** * @inheritdoc */ protected function classMap() { return array_merge(parent::classMap(), ['program' => 'Program']); }
public function insertOrUpdate(GenericEntity $entity) { $entityID = $entity->{"get" . ucfirst($entity->getIdcolumn())}(); $preparedStatement = NULL; if ($entityID != NULL) { $updateStatement = "update " . $entity->getTablename() . " set " . $this->getEntityValuesAsCommaSeperatedUpdateString($entity) . " where " . $entity->getIdcolumn() . "='" . $entityID . "';"; $preparedStatement = $this->PDO->prepare($updateStatement); $preparedStatement->execute(); return 0; } else { $insertStatement = "insert into " . $entity->getTablename() . " (" . $this->getEntityColumnsAsCommaSeperatedString($entity) . ") values (" . $this->getEntityValuesAsCommaSeperatedString($entity) . ");"; $preparedStatement = $this->PDO->prepare($insertStatement); $preparedStatement->execute(); return $this->PDO->lastInsertId(); } }
public function Kategorie() { parent::__construct("kategorie", "kategorieid"); }