Exemple #1
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;
         }
     }
 }
Exemple #2
0
 public function setPokemon($pokemon)
 {
     return Helper::utf8ify($pokemon);
 }