/** * Add a endpointProperty entity to this Endpoint's collection of properties. * This method also sets the EndpointProperty's parentEndpoint. * @param \EndpointProperty $endpointProperty */ public function addEndpointPropertyDoJoin($endpointProperty) { $this->endpointProperties[] = $endpointProperty; $endpointProperty->_setParentEndpoint($this); //$endpointProperty->getParentEndpoint() = $this; }
public function editEndpointProperty(\Service $service, \User $user, \EndpointProperty $prop, $newValues) { //Check the portal is not in read only mode, throws exception if it is $this->checkPortalIsNotReadOnlyOrUserIsAdmin($user); $this->validateAddEditDeleteActions($user, $service); $this->validate($newValues['ENDPOINTPROPERTIES'], 'endpointproperty'); $keyname = $newValues['ENDPOINTPROPERTIES']['NAME']; $keyvalue = $newValues['ENDPOINTPROPERTIES']['VALUE']; $this->checkNotReserved($user, $service, $keyname); $this->em->getConnection()->beginTransaction(); try { // Set the service 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; } }
public static function createSampleEndpointProperty($name, $key) { $prop = new EndpointProperty(); $prop->setKeyName($name); $prop->setKeyValue($key); return $prop; }