コード例 #1
0
 public function executeAttivitaGruppoArgomento()
 {
     // parametri obbligatori
     $this->ramo = $this->getRequestParameter('ramo');
     $gruppo_id = $this->getRequestParameter('gruppo_id');
     // parametri opzionali
     if ($this->hasRequestParameter('triple_value')) {
         $triple_value = $this->getRequestParameter('triple_value');
         $this->argomento = TagPeer::retrieveFirstByTripleValue($triple_value);
     }
     if ($this->hasRequestParameter('tag_name')) {
         $this->tag_name = $this->getRequestParameter('tag_name', '');
         $this->argomento = TagPeer::retrieveByTagName($this->tag_name);
     }
     if ($this->hasRequestParameter('tag_id')) {
         $this->tag_id = $this->getRequestParameter('tag_id', '');
         $this->argomento = TagPeer::retrieveByPK($this->tag_id);
     }
     $limit = null;
     if ($this->hasRequestParameter('limit')) {
         $limit = $this->getRequestParameter('limit');
     }
     // la data è passata come parametro o viene estratta l'ultima nella cache (per dati di tipo 'A', singoli atti)
     if ($this->hasRequestParameter('data')) {
         $this->data = $this->getRequestParameter('data');
     } else {
         $this->data = OppActHistoryCachePeer::fetchLastData();
     }
     $this->gruppo = OppGruppoPeer::retrieveByPK($gruppo_id);
     $this->forward404Unless($this->gruppo instanceof OppGruppo);
     $this->politici = OppCaricaPeer::getClassificaPoliticiSiOccupanoDiArgomenti(array($this->argomento->getId()), $this->ramo, $this->data, $limit, $gruppo_id, false);
 }
コード例 #2
0
ファイル: TagPeer.php プロジェクト: adatta02/comp190-code
 /**
  * Retrieves a tag by his name. If it does not exist, creates it (but does not
  * save it)
  *
  * @param      String      $tagname
  * @return     Tag
  */
 public static function retrieveOrCreateByTagname($tagname)
 {
     // retrieve or create the tag
     $tag = TagPeer::retrieveByTagName($tagname);
     if (!$tag) {
         $tag = new Tag();
         $tag->setName($tagname);
         $triple = sfPropelActAsTaggableToolkit::extractTriple($tagname);
         list($tagname, $triple_namespace, $triple_key, $triple_value) = $triple;
         $tag->setTripleNamespace($triple_namespace);
         $tag->setTripleKey($triple_key);
         $tag->setTripleValue($triple_value);
         $tag->setIsTriple(!is_null($triple_namespace));
     }
     return $tag;
 }