예제 #1
0
파일: Sql.php 프로젝트: enspdf/SupernovaPHP
 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;
 }
예제 #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);
 }