Exemplo n.º 1
0
 public function formatSocialMediaEnt(InstagramEntity $ent)
 {
     $socMedEnt = new SocialMediaEntity();
     $socMedEnt->setUsername($ent->getUsername())->setDateCreated(date("Y-m-d H:i:s"))->setBlvdId($ent->getBlvdId())->setLink($ent->getLink())->setMediaHeight(150)->setMediaWidth(150)->setText($ent->getCaption())->setSource('instagram')->setSocialId($ent->getId())->setMediaUrl($ent->getImage());
     return $socMedEnt;
 }
Exemplo n.º 2
0
 public function updateBlvdWithSocialMediaDatetime(SocialMediaEntity $socEnt)
 {
     $update = $this->sql->update();
     $update->set(array('last_social_media_datetime' => $socEnt->getDateCreated()))->where(array("id" => $socEnt->getBlvdId()))->where->lessThan("last_social_media_datetime", $socEnt->getDateCreated());
     $statement = $this->sql->prepareStatementForSqlObject($update);
     $result = $statement->execute();
     //echo "<br><br>".$update->getSqlString($this->dbAdapter->getPlatform());
     if (!$result) {
         return false;
     }
 }
Exemplo n.º 3
0
 public function insertSocialMedia(SocialMediaEntity $socMedEnt)
 {
     $select = $this->sql->select();
     $select->where(array("username" => $socMedEnt->getUsername(), "social_id" => $socMedEnt->getSocialId()));
     $result = $this->hydrateResult(new SocialMediaEntity(), $select);
     if ($result->count() == 0) {
         $hydrator = new ClassMethods();
         $data = $hydrator->extract($socMedEnt);
         $action = $this->sql->insert();
         $action->values($data);
         $statement = $this->sql->prepareStatementForSqlObject($action);
         // echo "<hr>"; echo $action->getSqlString($this->dbAdapter->getPlatform()); echo "<hr>asdf";
         $statement->execute();
         $sql = new Sql($this->dbAdapter);
         $sql->setTable('blvd');
         $update = $sql->update();
         $update->set(array("last_social_media_datetime" => $data['date_created']))->where(array("id" => $socMedEnt->getBlvdId()));
         $statement = $sql->prepareStatementForSqlObject($update);
         $r = $statement->execute();
         echo $action->getSqlString($this->dbAdapter->getPlatform());
     } elseif (false) {
         $hydrator = new ClassMethods();
         $data = $hydrator->extract($socMedEnt);
         $update = $this->sql->update();
         $update->set(array("date_created" => $data['date_created']))->where(array("username" => $socMedEnt->getUsername(), "social_id" => $socMedEnt->getSocialId()));
         $statement = $this->sql->prepareStatementForSqlObject($update);
         $r = $statement->execute();
         //echo "<hr>"; echo $update->getSqlString($this->dbAdapter->getPlatform()); echo "<hr>asdf";
         return $r;
     }
     return false;
 }
Exemplo n.º 4
0
 public function getMediaWidth()
 {
     return $this->utilObj->getSmallMediaWidth(parent::getMediaWidth(), parent::getMediaHeight());
 }