Esempio n. 1
0
 /**
  * Filter the query by a related \SpoilerWiki\Canon object
  *
  * @param \SpoilerWiki\Canon|ObjectCollection $canon the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildWorkTypeQuery The current query, for fluid interface
  */
 public function filterByCanon($canon, $comparison = null)
 {
     if ($canon instanceof \SpoilerWiki\Canon) {
         return $this->addUsingAlias(WorkTypeTableMap::COL_ID, $canon->getWorkTypeId(), $comparison);
     } elseif ($canon instanceof ObjectCollection) {
         return $this->useCanonQuery()->filterByPrimaryKeys($canon->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByCanon() only accepts arguments of type \\SpoilerWiki\\Canon or Collection');
     }
 }
Esempio n. 2
0
 /**
  * Filter the query by a related \SpoilerWiki\Canon object
  *
  * @param \SpoilerWiki\Canon|ObjectCollection $canon The related object(s) to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @throws \Propel\Runtime\Exception\PropelException
  *
  * @return ChildTopicQuery The current query, for fluid interface
  */
 public function filterBycanon($canon, $comparison = null)
 {
     if ($canon instanceof \SpoilerWiki\Canon) {
         return $this->addUsingAlias(TopicTableMap::COL_CANON_ID, $canon->getId(), $comparison);
     } elseif ($canon instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(TopicTableMap::COL_CANON_ID, $canon->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterBycanon() only accepts arguments of type \\SpoilerWiki\\Canon or Collection');
     }
 }
Esempio n. 3
0
    };
};
$app->hook('slim.before.dispatch', function () use($app) {
    //set up user if exists
    if (isset($_SESSION['user_id']) && $_SESSION['user_id']) {
        $user = \SpoilerWiki\UserQuery::create()->findPK($_SESSION['user_id']);
        $app->user = $user;
        $app->view()->appendData(array("user" => $user->toArray()));
    } else {
        $app->user = false;
        $app->view()->appendData(array("user" => false));
    }
});
$app->view->setTemplatesDirectory('../templates');
$app->get('/', function () use($app) {
    $canonList = \SpoilerWiki\Canon::fetchAll();
    $app->view()->display('index.twig', array("canonList" => $canonList));
});
$app->get('/series/:id', function ($seriesId) use($app) {
    $app->view()->display('series.twig', array());
});
$app->get('/topic/:id', function ($topicId) use($app) {
    $app->view()->display('topic.twig', array());
});
$app->get('/contribute', $checkAuth(), function () use($app) {
    $app->view()->display('contribute-home.twig', array("modules" => array(\SpoilerWiki\Widget\CanonList::create()->view(), \SpoilerWiki\Widget\ArtistList::create()->view())));
});
$app->map('/contribute/create/:model', $checkAuth(), function ($model) use($app) {
    $createForm = new \PropelForm\PropelForm("SpoilerWiki", $model);
    $createForm->getField("id")->setTemplate('partials/formInputs/id.twig');
    if ($app->request->isPost()) {
Esempio n. 4
0
 /**
  * @param ChildCanon $canon The ChildCanon object to add.
  */
 protected function doAddCanon(ChildCanon $canon)
 {
     $this->collCanons[] = $canon;
     $canon->setprimaryArtist($this);
 }
Esempio n. 5
0
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->aprimaryArtist) {
         $this->aprimaryArtist->removeWork($this);
     }
     if (null !== $this->acanon) {
         $this->acanon->removeWork($this);
     }
     $this->id = null;
     $this->name = null;
     $this->description = null;
     $this->primary_artist_id = null;
     $this->canon_id = null;
     $this->sortable_rank = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }
Esempio n. 6
0
 /**
  * Exclude object from result
  *
  * @param   ChildCanon $canon Object to remove from the list of results
  *
  * @return $this|ChildCanonQuery The current query, for fluid interface
  */
 public function prune($canon = null)
 {
     if ($canon) {
         $this->addUsingAlias(CanonTableMap::COL_ID, $canon->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
Esempio n. 7
0
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->auser) {
         $this->auser->removeAssignedRoleRelatedByUserId($this);
     }
     if (null !== $this->aassignedBy) {
         $this->aassignedBy->removeAssignedRoleRelatedByAssignedBy($this);
     }
     if (null !== $this->acanon) {
         $this->acanon->removeAssignedRole($this);
     }
     if (null !== $this->arole) {
         $this->arole->removeAssignedRole($this);
     }
     $this->id = null;
     $this->user_id = null;
     $this->canon_id = null;
     $this->role_id = null;
     $this->assigned_by = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }
Esempio n. 8
0
 /**
  * @param ChildCanon $canon The ChildCanon object to add.
  */
 protected function doAddCanon(ChildCanon $canon)
 {
     $this->collCanons[] = $canon;
     $canon->setworkType($this);
 }
Esempio n. 9
0
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->acanon) {
         $this->acanon->removeTopic($this);
     }
     if (null !== $this->aintroducedAt) {
         $this->aintroducedAt->removeTopic($this);
     }
     $this->id = null;
     $this->name = null;
     $this->canon_id = null;
     $this->introduced_at = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }