original_string: public function getPlans($page = '')
      {
          $planObjects = [];
          $plans = $this->getPlanResource()->getAll($page);
  
          if ($plans instanceof \Exception) {
              throw $plans;
          }
  
          foreach ($plans as $plan) {
              $planObject = new Plan($this->getPlanResource());
              $planObjects[] = $planObject->_setAttributes($plan);
          }
  
          return $planObjects;
      }
code: public function getPlans($page = '')
      {
          $planObjects = [];
          $plans = $this->getPlanResource()->getAll($page);
  
          if ($plans instanceof \Exception) {
              throw $plans;
          }
  
          foreach ($plans as $plan) {
              $planObject = new Plan($this->getPlanResource());
              $planObjects[] = $planObject->_setAttributes($plan);
          }
  
          return $planObjects;
      }
code_tokens: public function getPlans ( $ page = '' ) { $ planObjects = [ ] ; $ plans = $ this -> getPlanResource ( ) -> getAll ( $ page ) ; if ( $ plans instanceof \ Exception ) { throw $ plans ; } foreach ( $ plans as $ plan ) { $ planObject = new Plan ( $ this -> getPlanResource ( ) ) ; $ planObjects [ ] = $ planObject -> _setAttributes ( $ plan ) ; } return $ planObjects ; }
docstring: Get all plans.
  
  @param string $page
  
  @throws \Exception|mixed
  
  @return \Exception|mixed
docstring_tokens: Get all plans .