예제 #1
0
 public static function addOptionPrice($params, $currentUser, $con)
 {
     $option = NotificationOptionQuery::create()->filterByType('price')->filterByRoleId($params->role)->count($con);
     if ($option != 0) {
         throw new \Exception('Jabatan sudah dimasukkan');
     }
     $option = new NotificationOption();
     $option->setType('price')->setRoleId($params->role)->save($con);
     $results['success'] = true;
     $results['data'] = 'yay';
     return $results;
 }
예제 #2
0
 /**
  * Exclude object from result
  *
  * @param   ChildNotificationOption $notificationOption Object to remove from the list of results
  *
  * @return $this|ChildNotificationOptionQuery The current query, for fluid interface
  */
 public function prune($notificationOption = null)
 {
     if ($notificationOption) {
         $this->addUsingAlias(NotificationOptionTableMap::COL_ID, $notificationOption->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
예제 #3
0
 /**
  * Filter the query by a related \ORM\NotificationOption object
  *
  * @param \ORM\NotificationOption|ObjectCollection $notificationOption  the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildRoleQuery The current query, for fluid interface
  */
 public function filterByNotificationOption($notificationOption, $comparison = null)
 {
     if ($notificationOption instanceof \ORM\NotificationOption) {
         return $this->addUsingAlias(RoleTableMap::COL_ID, $notificationOption->getRoleId(), $comparison);
     } elseif ($notificationOption instanceof ObjectCollection) {
         return $this->useNotificationOptionQuery()->filterByPrimaryKeys($notificationOption->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByNotificationOption() only accepts arguments of type \\ORM\\NotificationOption or Collection');
     }
 }
예제 #4
0
파일: Role.php 프로젝트: AlvaCorp/POS-2
 /**
  * @param ChildNotificationOption $notificationOption The ChildNotificationOption object to add.
  */
 protected function doAddNotificationOption(ChildNotificationOption $notificationOption)
 {
     $this->collNotificationOptions[] = $notificationOption;
     $notificationOption->setRole($this);
 }