/** * @param \Backend\Database\Schemas\ILove $obj * * @return bool */ public function create($obj) { if (is_object($obj)) { $this->clean($obj); $this->love = $obj->getLove(); $this->synced = $obj->getSynced(); if ($this->c->execute()) { $notification = new Notifications($this->getConnection()); $obj = new Notification(null, "New ILove"); $notification->create($obj); return true; } } return false; }
/** * Creates a new row in database table * * @param Reassure $obj * * @return bool True on success, false otherwise */ public function create($obj) { if (is_object($obj)) { $this->clean($obj); $this->reassure = $obj->getReassure(); $this->synced = $obj->getSynced(); $this->toUpdate = $obj->getToUpdate(); if ($this->c->execute()) { $notification = new Notifications($this->getConnection()); $obj = new Notification(null, "New Reassurance"); $notification->create($obj); return true; } } return false; }
/** * @param Poem $obj * * @return bool */ public function create($obj) { if (is_object($obj)) { $this->clean($obj); $this->author = $obj->getAuthor(); $this->date = $obj->getDate(); $this->name = $obj->getName(); $this->poem = $obj->getPoem(); $this->favourite = $obj->getFavourite(); $this->synced = $obj->getSynced(); $this->toUpdate = $obj->getToUpdate(); if ($this->c->execute()) { $notification = new Notifications($this->getConnection()); $obj = new Notification(null, "New Poem"); $notification->create($obj); return true; } } return false; }
<?php /** * Created by PhpStorm. * User: evolutionarycoder * Date: 2/17/16 * Time: 12:41 PM * */ header("Cache-Control: no-cache, no-store"); header("Pragma: no-cache"); use Backend\Database\Tables\Notifications; use Backend\Helpers\Email; include "../../../vendor/autoload.php"; if (isset($_GET["fetch"])) { $table = new Notifications(); if ($table->createJson()) { $email = new Email("MyLove Synced", "Table " . Notifications::TABLE_NAME); $email->send(); header("Location: ../json/" . Notifications::JSON_NAME); } else { echo "false"; } }