Exemple #1
0
 /**
  * @static
  * @param int $userId
  * @param int $repositoryId
  * @param int $branchId
  * @param int $oldStatus
  * @param int $newStatus
  * @param string $message
  * @return int
  */
 public static function saveAction($userId, $repositoryId, $branchId, $oldStatus, $newStatus, $message = 'status was changed from <strong>%s</strong> to <strong>%s</strong>')
 {
     if ($oldStatus === $newStatus) {
         return 0;
     }
     $branch = BranchQuery::create()->filterById($branchId)->findOne();
     if (!$branch) {
         return false;
     }
     $statusAction = new StatusAction();
     return $statusAction->setUserId($userId)->setRepositoryId($repositoryId)->setBranchId($branchId)->setOldStatus($oldStatus)->setNewStatus($newStatus)->setMessage(sprintf($message, BranchPeer::getLabelStatus($oldStatus), BranchPeer::getLabelStatus($newStatus)))->save();
 }
Exemple #2
0
 /**
  * @param	StatusAction $statusAction The statusAction object to add.
  */
 protected function doAddStatusAction($statusAction)
 {
     $this->collStatusActions[] = $statusAction;
     $statusAction->setsfGuardUser($this);
 }
Exemple #3
0
 /**
  * Filter the query by a related StatusAction object
  *
  * @param     StatusAction $statusAction  the related object to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return    RepositoryQuery The current query, for fluid interface
  */
 public function filterByStatusAction($statusAction, $comparison = null)
 {
     if ($statusAction instanceof StatusAction) {
         return $this->addUsingAlias(RepositoryPeer::ID, $statusAction->getRepositoryId(), $comparison);
     } elseif ($statusAction instanceof PropelCollection) {
         return $this->useStatusActionQuery()->filterByPrimaryKeys($statusAction->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByStatusAction() only accepts arguments of type StatusAction or PropelCollection');
     }
 }
Exemple #4
0
 /**
  * @param	StatusAction $statusAction The statusAction object to add.
  */
 protected function doAddStatusAction($statusAction)
 {
     $this->collStatusActions[] = $statusAction;
     $statusAction->setBranch($this);
 }
 /**
  * Exclude object from result
  *
  * @param     StatusAction $statusAction Object to remove from the list of results
  *
  * @return    StatusActionQuery The current query, for fluid interface
  */
 public function prune($statusAction = null)
 {
     if ($statusAction) {
         $this->addUsingAlias(StatusActionPeer::ID, $statusAction->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
Exemple #6
0
 /**
  * @param	StatusAction $statusAction The statusAction object to add.
  */
 protected function doAddStatusAction($statusAction)
 {
     $this->collStatusActions[] = $statusAction;
     $statusAction->setRepository($this);
 }