/**
  * @return AssociationFactory
  */
 public static function getInstance()
 {
     if (!is_object(self::$instance)) {
         self::$instance = new AssociationFactory();
     }
     return self::$instance;
 }
 /**
  * @param ISurveyQuestionTemplate $question
  * @return $this
  */
 public function addQuestion(ISurveyQuestionTemplate $question)
 {
     $query = new QueryObject();
     $query->addOrder(QueryOrder::asc('Order'));
     return AssociationFactory::getInstance()->getOne2ManyAssociation($this, 'Questions', $query)->add($question);
     return $this;
 }
 public function clearRegionalSupports()
 {
     $regional_supports = AssociationFactory::getInstance()->getOne2ManyAssociation($this, 'RegionalSupports');
     foreach ($regional_supports as $regional_support) {
         $regional_support->clearChannelTypes();
     }
     $regional_supports->removeAll();
 }
 /**
  * @param IDataCenterLocation $location
  */
 public function setLocation(IDataCenterLocation $location)
 {
     AssociationFactory::getInstance()->getMany2OneAssociation($this, 'Location', 'AvailabilityZones')->setTarget($location);
 }
Ejemplo n.º 5
0
 /**
  * @param IJobRegistrationRequest $request
  * @return void
  */
 public function setLastJobRegistrationRequest(IJobRegistrationRequest $request)
 {
     AssociationFactory::getInstance()->getMany2OneAssociation($this, 'LastJobRegistrationRequest')->setTarget($request);
 }
Ejemplo n.º 6
0
 /**
  * @return ICommunityMember[]
  */
 public function getTeamMembers()
 {
     return AssociationFactory::getInstance()->getMany2ManyAssociation($this, 'EditorTeam')->toArray();
 }
 public function clearPricingSchemas()
 {
     AssociationFactory::getInstance()->getMany2ManyAssociation($this, 'PricingSchemas')->removeAll();
 }
Ejemplo n.º 8
0
 public function registerCheckInOnEvent(ISummitEvent $summit_event)
 {
     AssociationFactory::getInstance()->getMany2ManyAssociation($this, 'Schedule')->remove($summit_event);
     AssociationFactory::getInstance()->getMany2ManyAssociation($this, 'Schedule')->add($summit_event, array('IsCheckedIn' => true));
 }
Ejemplo n.º 9
0
 /**
  * @param ICommunityMember $member
  * @return void
  */
 public function updateMember(ICommunityMember $member)
 {
     AssociationFactory::getInstance()->getMany2OneAssociation($this, 'Member')->setTarget($member);
 }
 /**
  * @return ISurveyQuestionTemplate
  */
 public function getTargetQuestion()
 {
     return AssociationFactory::getInstance()->getMany2OneAssociation($this, 'TargetField')->getTarget();
 }
Ejemplo n.º 11
0
 public function clearVersions()
 {
     AssociationFactory::getInstance()->getOne2ManyAssociation($this, 'Versions')->removeAll();
 }
Ejemplo n.º 12
0
 public function removeDocument()
 {
     $target = AssociationFactory::getInstance()->getMany2OneAssociation($this, 'Document')->getTarget();
     if ($target->Name) {
         $target->deleteDatabaseOnly();
     }
 }
 /**
  * @return ISurveyQuestionTemplate[]
  */
 public function getQuestions()
 {
     $query = new QueryObject();
     $query->addOrder(QueryOrder::asc('Order'));
     return AssociationFactory::getInstance()->getOne2ManyAssociation($this, 'Questions', $query)->toArray();
 }
Ejemplo n.º 14
0
 /**
  * @return IEntitySurveyTemplate[]
  */
 public function getEntities()
 {
     return AssociationFactory::getInstance()->getOne2ManyAssociation($this, 'EntitySurveys')->toArray();
 }
Ejemplo n.º 15
0
 /**
  * @return void
  */
 public function clearDataCenterRegions()
 {
     AssociationFactory::getInstance()->getOne2ManyAssociation($this, 'DataCenterRegions')->removeAll();
 }
 /**
  * @return IEntitySurveyTemplate
  */
 public function getEntity()
 {
     return AssociationFactory::getInstance()->getMany2OneAssociation($this, 'Entity')->getTarget();
 }
Ejemplo n.º 17
0
 /**
  * @param ISurveyStep $step
  * @return void
  */
 public function removeStep(ISurveyStep $step)
 {
     $step->clear();
     AssociationFactory::getInstance()->getOne2ManyAssociation($this, 'Steps')->remove($step);
 }
 /**
  * @param IPresentationSpeaker $speaker
  * @return $this
  */
 public function assignSpeaker(IPresentationSpeaker $speaker)
 {
     AssociationFactory::getInstance()->getMany2OneAssociation($this, 'Speaker')->setTarget($speaker);
 }
 public function clearResources()
 {
     AssociationFactory::getInstance()->getOne2ManyAssociation($this, 'Resources')->removeAll();
 }
Ejemplo n.º 20
0
 /**
  * @return void
  */
 public function clearAllFeedback()
 {
     AssociationFactory::getInstance()->getOne2ManyAssociation($this, 'Feedback')->removeAll();
 }
 /**
  * @param IReleaseSupportedApiVersion $release_supported_api_version
  * @return void
  */
 public function setReleaseSupportedApiVersion(IReleaseSupportedApiVersion $release_supported_api_version)
 {
     AssociationFactory::getInstance()->getMany2OneAssociation($this, 'ReleaseSupportedApiVersion')->setTarget($release_supported_api_version);
 }
 /**
  * @param IQuestionValueTemplate $value
  * @return $this
  */
 public function addValue(IQuestionValueTemplate $value)
 {
     $query = new QueryObject();
     $query->addOrder(QueryOrder::asc('Order'));
     AssociationFactory::getInstance()->getOne2ManyAssociation($this, 'Values', $query)->add($value);
     return $this;
 }
Ejemplo n.º 23
0
 public function setMember(ICLAMember $member)
 {
     AssociationFactory::getInstance()->getMany2OneAssociation($this, 'Member')->setTarget($member);
 }
Ejemplo n.º 24
0
 /**
  * @return array|IOpenStackApiVersion[]
  */
 public function getSupportedApiVersions()
 {
     return AssociationFactory::getInstance()->getOne2ManyAssociation($this, 'SupportedApiVersions')->toArray();
 }
Ejemplo n.º 25
0
 /**
  * @param IConsultant $consultant
  * @return void
  */
 public function setConsultant(IConsultant $consultant)
 {
     AssociationFactory::getInstance()->getMany2OneAssociation($this, 'Consultant', 'Offices')->setTarget($consultant);
 }
Ejemplo n.º 26
0
 /**
  * @param ICompanyService $owner
  * @return void
  */
 public function setOwner(ICompanyService $owner)
 {
     AssociationFactory::getInstance()->getMany2OneAssociation($this, 'Owner', 'Videos')->setTarget($owner);
 }
Ejemplo n.º 27
0
 /**
  * @return void
  */
 public function clearAllVenues()
 {
     $query = new QueryObject(new SummitVenue());
     $query->addAndCondition(QueryCriteria::equal('ClassName', 'SummitVenue'));
     AssociationFactory::getInstance()->getOne2ManyAssociation($this, 'Locations', $query)->removeAll();
 }
Ejemplo n.º 28
0
 /**
  * @param string $value
  * @param int $time_stamp
  * @return void
  */
 public function addSample($value, $time_stamp)
 {
     $sample = new RoomMetricSampleData();
     $sample->Value = floatval($value);
     $sample->TimeStamp = intval($time_stamp);
     AssociationFactory::getInstance()->getOne2ManyAssociation($this, 'Samples')->add($sample);
 }
 /**
  * @param IDataCenterRegion $region
  * @return void
  */
 public function setDataCenterRegion(IDataCenterRegion $region)
 {
     AssociationFactory::getInstance()->getMany2OneAssociation($this, 'DataCenterRegion', 'Locations')->setTarget($region);
 }
 /**
  * @return ISummitPackage
  */
 public function package()
 {
     return AssociationFactory::getInstance()->getMany2OneAssociation($this, 'Package')->getTarget();
 }