public function addMe($nick, $password, $email, $name) { $dao = new dao(); $product = array("nick" => $nick, "password" => $password, "email" => $email, "name" => $name); try { $returnObject = $dao->inster($product, "product"); } catch (Exception $e) { throw new Exception("Failed product addMe: " . $e->getMessage()); } return $this->addData($returnObject); }
public function addMe($nick, $password, $email, $name) { $dao = new dao(); $club = array("email" => $email, "name" => $name); try { $returnObject = $dao->inster($club, "club"); } catch (Exception $e) { throw new Exception("Failed club addMe: " . $e->getMessage()); } return $this->addData($returnObject); }
public function addMe($id_event, $id_product, $id_user, $date_ini) { $dao = new dao(); $product = array("id_event" => $id_event, "id_product" => $id_product, "id_user" => $id_user, "date_ini" => $date_ini); try { $returnObject = $dao->inster($product, "product"); } catch (Exception $e) { throw new Exception("Failed product addMe: " . $e->getMessage()); } return $this->addData($returnObject); }
public function inviteFriend($user_id, $event_id) { $dao = new dao(); $event_user = array("id_event" => $event_id, "id_user" => $user_id); try { $dao->inster($event_user, "event_user"); return $event_user; } catch (Exception $e) { throw new Exception("Failed event_user addMe: " . $e->getMessage()); } }
public function post($user_id, $coment, $media) { $timestamp = new DateTime(); $id_post = hash('md5', $timestamp->getTimestamp() . $user_id); $dao = new dao(); $post = array("id_post" => $id_post, "coment" => $coment, "media" => $media); $post_user = array("id_user" => $user_id, "id_post" => $id_post); try { $returnObject = $dao->inster($post, "post"); $returnObject = $dao->inster($post_user, "post_user"); return $returnObject; } catch (Exception $e) { throw new Exception("Failed conecting posting " . $wantToFollow_id . " Message: " . $e->getMessage()); } }