public function newAction() { $userInfo = Zend_Auth::getInstance()->getStorage()->read(); if (!$this->isAuthorized(-1)) { // TODO: this header call does not actually print any error message header("Status: 401 Not Authorized"); return; } $webstream = new CcWebstream(); //we're not saving this primary key in the DB so it's OK to be -1 $webstream->setDbId(-1); $webstream->setDbName(_("Untitled Webstream")); $webstream->setDbDescription(""); $webstream->setDbUrl("http://"); $webstream->setDbLength("00:30:00"); $webstream->setDbName(_("Untitled Webstream")); $webstream->setDbCreatorId($userInfo->id); $webstream->setDbUtime(new DateTime("now", new DateTimeZone('UTC'))); $webstream->setDbMtime(new DateTime("now", new DateTimeZone('UTC'))); //clear the session in case an old playlist was open: CC-4196 Application_Model_Library::changePlaylist(null, null); $this->view->obj = new Application_Model_Webstream($webstream); $this->view->action = "new"; $this->view->html = $this->view->render('webstream/webstream.phtml'); }
/** * Exclude object from result * * @param CcWebstream $ccWebstream Object to remove from the list of results * * @return CcWebstreamQuery The current query, for fluid interface */ public function prune($ccWebstream = null) { if ($ccWebstream) { $this->addUsingAlias(CcWebstreamPeer::ID, $ccWebstream->getDbId(), Criteria::NOT_EQUAL); } return $this; }
/** * Filter the query by a related CcWebstream object * * @param CcWebstream $ccWebstream the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return CcScheduleQuery The current query, for fluid interface */ public function filterByCcWebstream($ccWebstream, $comparison = null) { return $this->addUsingAlias(CcSchedulePeer::STREAM_ID, $ccWebstream->getDbId(), $comparison); }
public static function save($parameters, $mime, $mediaUrl, $di) { $userInfo = Zend_Auth::getInstance()->getStorage()->read(); $id = $parameters['id']; if ($id != -1) { $webstream = CcWebstreamQuery::create()->findPK($id); } else { $webstream = new CcWebstream(); } $webstream->setDbName($parameters["name"]); $webstream->setDbDescription($parameters["description"]); $webstream->setDbUrl($mediaUrl); $dblength = $di->format("%H:%I"); $webstream->setDbLength($dblength); $webstream->setDbCreatorId($userInfo->id); $webstream->setDbUtime(new DateTime("now", new DateTimeZone('UTC'))); $webstream->setDbMtime(new DateTime("now", new DateTimeZone('UTC'))); $ws = new Application_Model_Webstream($webstream); $webstream->setDbMime($mime); $webstream->save(); return $webstream->getDbId(); }
/** * Declares an association between this object and a CcWebstream object. * * @param CcWebstream $v * @return CcSchedule The current object (for fluent API support) * @throws PropelException */ public function setCcWebstream(CcWebstream $v = null) { if ($v === null) { $this->setDbStreamId(NULL); } else { $this->setDbStreamId($v->getDbId()); } $this->aCcWebstream = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the CcWebstream object, it will not be re-added. if ($v !== null) { $v->addCcSchedule($this); } return $this; }
/** * Adds an object to the instance pool. * * Propel keeps cached copies of objects in an instance pool when they are retrieved * from the database. In some cases -- especially when you override doSelect*() * methods in your stub classes -- you may need to explicitly add objects * to the cache in order to ensure that the same objects are always returned by doSelect*() * and retrieveByPK*() calls. * * @param CcWebstream $value A CcWebstream object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool(CcWebstream $obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = (string) $obj->getDbId(); } // if key === null self::$instances[$key] = $obj; } }