Example #1
0
 public function execute($input_parameters = null)
 {
     try {
         return parent::execute($input_parameters);
     } catch (Exception $e) {
         TPP::setError($e);
     }
 }
Example #2
0
 /**
  * @param string $content
  * @param null   $options
  *
  * @return PDOStatement
  */
 public function prepare($content, $options = [])
 {
     try {
         $this->log($content);
         $prepare = parent::prepare($content, $options);
         $prepare2 =& $prepare;
         $this->log($prepare2, 'prepare', false);
         return $prepare2;
     } catch (Exception $e) {
         TPP::setError($e);
     }
 }
Example #3
0
 public function setAttributes($attributes)
 {
     foreach ($attributes as $key => $value) {
         if (isset($value) && $value !== '') {
             if (!property_exists($this, $key)) {
                 $called_class = get_called_class();
                 TPP::setError($called_class . "->" . $key . ": Property '" . $key . "' does not exist for class '" . $called_class . "'");
             }
             $key = gettype($key) === 'string' && !ctype_alnum(str_replace(['-', '_', ' '], '', $key)) ? Helper::utf8ify($key) : $key;
             $this->{$key} = gettype($value) === 'string' ? Helper::utf8ify($value) : $value;
         }
     }
 }
Example #4
0
 public function setMoves($moves)
 {
     if ($moves) {
         $return = [];
         if (is_string($moves)) {
             $ex = explode(',', $moves);
         } elseif (is_array($moves) && !empty($moves)) {
             $ex = $moves;
         } else {
             TPP::setError('Unknown handling of moves: ' . $moves);
             return;
         }
         foreach ($ex as $m) {
             $model = new Move();
             $model->name = $m;
             $return[] = $model;
         }
         return $return;
     }
 }