Exemplo n.º 1
0
 /**
  * Metodo che estrae le informazioni del madia dal db e le passa al metodo di validazione
  */
 private function getMediaInfo()
 {
     $qMediaInfo = "SELECT " . self::MEDIA_CHECK_FIELDS . " FROM `" . constant('media_type::' . $this->mediaType) . "` WHERE id  = " . $this->mediaId;
     //pr($qMediaInfo);
     $query = new aeq($qMediaInfo, true);
     $this->mediaData = $query->fetch();
     //pr($this->mediaData);
     // converto la stringa visibility in array
     $this->mediaData['visibility'] = explode(",", $this->mediaData['visibility']);
     $this->checkVisibility();
     unset($query);
     return $this;
 }
Exemplo n.º 2
0
 public function getMediaList()
 {
     // Estraggo tutti i contenuti di proprietà del gruppo dell'utente indicato, prelevando sole le dimensioni.
     $qStringMedia = "SELECT " . self::QUOTA_FIELDS_CHECK . " FROM `" . constant('media_type::' . $this->Object) . "` WHERE cerebrumGroupId = '" . $this->cerebrumGroupId . "'";
     $qMediaList = new aeq($qStringMedia, true);
     $this->mediaList = [];
     while ($rowMedia = $qMediaList->fetch()) {
         $this->mediaList[] = $rowMedia;
     }
     unset($qMediaList);
     //pr($this->mediaList);
     return $this;
 }
Exemplo n.º 3
0
 /**
  * Metodo che calcola il prossimo id positivo
  * eseguendo il lock della tabella e verificando l'id più alto +1
  *
  * @param string $Field     optional - nome del campo sul quale eseguire la verifica (default id)
  * @return int id
  */
 private final function getNextMaxId($Field = "id")
 {
     $q = "SELECT (MAX({$Field})+1)AS id FROM `" . $this->Table . "` LOCK IN SHARE MODE";
     $query = new aeq($q, true);
     $row = $query->fetch();
     unset($query);
     return $row['id'];
 }