/**
  * Edit a criterion
  *
  * @param null|string $criteriondata
  * @param null|string $criteriontype
  * @param Criteriagroup $criteriagroup
  * @param Criterion $criterion
  * @return Criterion
  */
 public function editCriterion($criteriondata = null, $criteriontype = null, Criteriagroup $criteriagroup, Criterion $criterion)
 {
     // Update criterion properties
     $criterion->setData($criteriondata);
     $criterion->setCtype($criteriontype);
     $criterion->setCriteriagroup($criteriagroup);
     // Save modifications
     $this->om->persist($criterion);
     return $criterion;
 }
Пример #2
0
 /**
  * Update an existing Criterion.
  *
  * @param Criteriagroup $group
  * @param \stdClass     $criterionStructure
  * @param Criterion     $criterion
  *
  * @return Criterion
  */
 public function editCriterion(Criteriagroup $group, \stdClass $criterionStructure, Criterion $criterion)
 {
     // Update criterion properties
     $criterion->setData($criterionStructure->data ? $criterionStructure->data : null);
     $criterion->setCtype($criterionStructure->type ? $criterionStructure->type : null);
     $criterion->setCriteriagroup($group);
     // Save modifications
     $this->om->persist($criterion);
     return $criterion;
 }