本文整理汇总了PHP中dao::inster方法的典型用法代码示例。如果您正苦于以下问题:PHP dao::inster方法的具体用法?PHP dao::inster怎么用?PHP dao::inster使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dao
的用法示例。
在下文中一共展示了dao::inster方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addMe
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);
}
示例2: addMe
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);
}
示例3: addMe
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);
}
示例4: inviteFriend
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());
}
}
示例5: post
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());
}
}