public function updateAvatar($destination)
 {
     $stmt = self::$db_handler->prepare('UPDATE user SET icon_url=? WHERE uid=?');
     $i = 1;
     $stmt->bindValue($i++, $destination, Mapper::getType($destination));
     $uid = $_SESSION[Controller::UID];
     $stmt->bindValue($i, $uid, Mapper::getType($uid));
     $stmt->execute();
 }
Exemple #2
0
 /**
  * @param array $data
  * @return mixed -- execution result
  * @internal param DomainObject $object -- This object is for insert, so may be part
  * of full info
  */
 protected function doInsert(array $data)
 {
     //        print "inserting\n";
     //        debug_print_backtrace();
     $stmt = $this->insertStmt();
     $i = 1;
     foreach ($data as $value) {
         $stmt->bindValue($i++, $value, Mapper::getType($value));
     }
     return $stmt->execute();
 }