Example #1
0
 public static function removeResult($object)
 {
     if (self::connect()) {
         $namespace = explode("\\", get_class($object));
         $model = end($namespace);
         $results = $object->toArray();
         $table = \Supernova\Inflector::camelToUnder(\Supernova\Inflector::pluralize($model));
         $query = 'DELETE FROM ' . $table . ' WHERE `' . $object->primaryKey . '`=\'' . \Supernova\Security::sanitize($results[$object->primaryKey]) . '\'';
         $sth = self::$connection->prepare($query);
         return $sth->execute();
     }
     return false;
 }
Example #2
0
 /**
  * Ingresa parametros GET
  * @param array $params Parametros GET
  */
 public static function setGetParameters($params = array())
 {
     self::$request['get'] = \Supernova\Security::sanitize($params);
     unset($_GET);
 }