Ejemplo n.º 1
0
 public function saveUsuarisAppsList($con = null)
 {
     if (!$this->isValid()) {
         throw $this->getErrorSchema();
     }
     if (!isset($this->widgetSchema['usuaris_apps_list'])) {
         // somebody has unset this widget
         return;
     }
     if (null === $con) {
         $con = $this->getConnection();
     }
     $c = new Criteria();
     $c->add(UsuarisAppsPeer::APP_ID, $this->object->getPrimaryKey());
     UsuarisAppsPeer::doDelete($c, $con);
     $values = $this->getValue('usuaris_apps_list');
     if (is_array($values)) {
         foreach ($values as $value) {
             $obj = new UsuarisApps();
             $obj->setAppId($this->object->getPrimaryKey());
             $obj->setUsuariId($value);
             $obj->save();
         }
     }
 }
Ejemplo n.º 2
0
 public static function initialize($IDA, $IDU, $idS)
 {
     $OA = self::retrieveByPK($IDU, $IDA);
     if (!$OA instanceof UsuarisApps) {
         $OA = new UsuarisApps();
         $OA->setSiteId($idS);
         $OA->setActiu(true);
     }
     return new UsuarisAppsForm($OA, array('IDS' => $idS));
 }
Ejemplo n.º 3
0
 /**
  * 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      UsuarisApps $value A UsuarisApps object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(UsuarisApps $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = serialize(array((string) $obj->getUsuariId(), (string) $obj->getAppId()));
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }