Esempio n. 1
0
 public static function getAll($prjUid = null, $start = null, $limit = null, $filter = '', $changeCaseTo = CASE_UPPER)
 {
     $c = new Criteria('workflow');
     $c->addSelectColumn("BPMN_DIAGRAM.*");
     if (!is_null($prjUid)) {
         $c->add(BpmnDiagramPeer::PRJ_UID, $prjUid, Criteria::EQUAL);
     }
     $rs = BpmnDiagramPeer::doSelectRS($c);
     $rs->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
     $diagrams = array();
     while ($rs->next()) {
         $diagrams[] = $changeCaseTo !== CASE_UPPER ? array_change_key_case($rs->getRow(), CASE_LOWER) : $rs->getRow();
     }
     return $diagrams;
 }
Esempio n. 2
0
 /**
  * Returns the number of related BpmnDiagrams.
  *
  * @param      Criteria $criteria
  * @param      boolean $distinct
  * @param      Connection $con
  * @throws     PropelException
  */
 public function countBpmnDiagrams($criteria = null, $distinct = false, $con = null)
 {
     // include the Peer class
     include_once 'classes/model/om/BaseBpmnDiagramPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     $criteria->add(BpmnDiagramPeer::PRJ_UID, $this->getPrjUid());
     return BpmnDiagramPeer::doCount($criteria, $distinct, $con);
 }
Esempio n. 3
0
 /**
  * Get the associated BpmnDiagram object
  *
  * @param      Connection Optional Connection object.
  * @return     BpmnDiagram The associated BpmnDiagram object.
  * @throws     PropelException
  */
 public function getBpmnDiagram($con = null)
 {
     // include the related Peer class
     include_once 'classes/model/om/BaseBpmnDiagramPeer.php';
     if ($this->aBpmnDiagram === null && ($this->dia_uid !== "" && $this->dia_uid !== null)) {
         $this->aBpmnDiagram = BpmnDiagramPeer::retrieveByPK($this->dia_uid, $con);
         /* The following can be used instead of the line above to
              guarantee the related object contains a reference
              to this object, but this level of coupling
              may be undesirable in many circumstances.
              As it can lead to a db query with many results that may
              never be used.
              $obj = BpmnDiagramPeer::retrieveByPK($this->dia_uid, $con);
              $obj->addBpmnDiagrams($this);
            */
     }
     return $this->aBpmnDiagram;
 }
 /**
  * Retrieve multiple objects by pkey.
  *
  * @param      array $pks List of primary keys
  * @param      Connection $con the connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *       rethrown wrapped into a PropelException.
  */
 public static function retrieveByPKs($pks, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria();
         $criteria->add(BpmnDiagramPeer::DIA_UID, $pks, Criteria::IN);
         $objs = BpmnDiagramPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Esempio n. 5
0
 /**
  * Populates the object using an array.
  *
  * This is particularly useful when populating an object from one of the
  * request arrays (e.g. $_POST).  This method goes through the column
  * names, checking to see whether a matching key exists in populated
  * array. If so the setByName() method is called for that column.
  *
  * You can specify the key type of the array by additionally passing one
  * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
  * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
  *
  * @param      array  $arr     An array to populate the object from.
  * @param      string $keyType The type of keys the array uses.
  * @return     void
  */
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = BpmnDiagramPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setDiaUid($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setPrjUid($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setDiaName($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setDiaIsClosable($arr[$keys[3]]);
     }
 }
 /**
  * Selects a collection of BpmnBound objects pre-filled with all related objects except BpmnProject.
  *
  * @return     array Array of BpmnBound objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *       rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptBpmnProject(Criteria $c, $con = null)
 {
     $c = clone $c;
     // Set the correct dbName if it has not been overridden
     // $c->getDbName() will return the same object if not set to another value
     // so == check is okay and faster
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     BpmnBoundPeer::addSelectColumns($c);
     $startcol2 = BpmnBoundPeer::NUM_COLUMNS - BpmnBoundPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     BpmnDiagramPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + BpmnDiagramPeer::NUM_COLUMNS;
     $c->addJoin(BpmnBoundPeer::DIA_UID, BpmnDiagramPeer::DIA_UID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = BpmnBoundPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = BpmnDiagramPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getBpmnDiagram();
             //CHECKME
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addBpmnBound($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initBpmnBounds();
             $obj2->addBpmnBound($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }