Esempio n. 1
0
 /**
  * Returns the number of related BpmnParticipants.
  *
  * @param      Criteria $criteria
  * @param      boolean $distinct
  * @param      Connection $con
  * @throws     PropelException
  */
 public function countBpmnParticipants($criteria = null, $distinct = false, $con = null)
 {
     // include the Peer class
     include_once 'classes/model/om/BaseBpmnParticipantPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     $criteria->add(BpmnParticipantPeer::PRJ_UID, $this->getPrjUid());
     return BpmnParticipantPeer::doCount($criteria, $distinct, $con);
 }
Esempio n. 2
0
    public function removeParticipant($parUid)
    {
        try {
            self::log("Remove Participant: $parUid");

            $participant = ParticipantPeer::retrieveByPK($parUid);
            $participant->delete();

            // remove related object (flows)
            Flow::removeAllRelated($parUid);

            self::log("Remove Participant Success!");
        } catch (\Exception $e) {
            self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString());
            throw $e;
        }
    }
Esempio n. 3
0
 public static function exists($actUid)
 {
     $c = new Criteria("workflow");
     $c->add(BpmnParticipantPeer::PAR_UID, $actUid);
     return BpmnParticipantPeer::doCount($c) > 0 ? true : false;
 }
 /**
  * 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 = BpmnParticipantPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setParUid($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setPrjUid($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setProUid($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setLnsUid($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setParName($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setParMinimum($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setParMaximum($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setParNumParticipants($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setParIsHorizontal($arr[$keys[8]]);
     }
 }