예제 #1
0
 /**
  * To list all enable states for this object.
  * @api
  *
  * @return string[]
  */
 public function listEnabledStates()
 {
     if ($this->activesStates instanceof \ArrayAccess) {
         return array_keys($this->activesStates->getArrayCopy());
     } else {
         return [];
     }
 }
예제 #2
0
파일: Country.php 프로젝트: ekyna/commerce
 /**
  * @inheritdoc
  */
 public function removeState(StateInterface $state)
 {
     if ($this->hasState($state)) {
         $state->setCountry(null);
         $this->states->removeElement($state);
     }
     return $this;
 }
예제 #3
0
 /**
  * Return state from collection by its name
  *
  * @param string $name
  *
  * @return State
  */
 private function getState($name)
 {
     return $this->states->get($name);
 }