Ejemplo n.º 1
0
 public static function createSampleServiceGroupProperty($name, $key)
 {
     $prop = new ServiceGroupProperty();
     $prop->setKeyName($name);
     $prop->setKeyValue($key);
     return $prop;
 }
Ejemplo n.º 2
0
 /**
  * Add a ServiceGroupProperty entity to this Service's collection of properties. 
  * This method also sets the ServiceGroupProperty's parentService.  
  * @param \ServiceGroupProperty $serviceGroupProperty
  */
 public function addServiceGroupPropertyDoJoin($serviceGroupProperty)
 {
     $this->serviceGroupProperties[] = $serviceGroupProperty;
     $serviceGroupProperty->_setParentServiceGroup($this);
 }
Ejemplo n.º 3
0
 /**
  * Edits a service group property
  *
  * @param \ServiceGroup $serviceGroup
  * @param \User $user
  * @param \ServiceGroupProperty $prop
  * @param $newValues
  *        	
  */
 public function editServiceGroupProperty(\ServiceGroup $serviceGroup, \User $user = null, \ServiceGroupProperty $prop, $newValues)
 {
     // Check the portal is not in read only mode, throws exception if it is
     $this->checkPortalIsNotReadOnlyOrUserIsAdmin($user);
     $this->validate($newValues['SERVICEGROUPPROPERTIES'], 'servicegroupproperty');
     $keyname = $newValues['SERVICEGROUPPROPERTIES']['NAME'];
     $keyvalue = $newValues['SERVICEGROUPPROPERTIES']['VALUE'];
     $this->checkNotReserved($user, $serviceGroup, $keyname);
     $this->em->getConnection()->beginTransaction();
     try {
         // Set the site propertys new member variables
         $prop->setKeyName($keyname);
         $prop->setKeyValue($keyvalue);
         $this->em->merge($prop);
         $this->em->flush();
         $this->em->getConnection()->commit();
     } catch (\Exception $ex) {
         $this->em->getConnection()->rollback();
         $this->em->close();
         throw $ex;
     }
 }