예제 #1
0
 /**
  * This object will be used if another one is not passed
  *
  * @return \XLite\Model\Address
  */
 protected function getDefaultModelObject()
 {
     if (!isset($this->address)) {
         $addressId = $this->getAddressId();
         if (isset($addressId)) {
             $this->address = \XLite\Core\Database::getRepo('XLite\\Model\\Address')->find($this->getAddressId());
         } else {
             $this->address = new \XLite\Model\Address();
             $profileId = $this->getProfileId();
             if (0 < intval($profileId)) {
                 $profile = \XLite\Core\Database::getRepo('XLite\\Model\\Profile')->find($profileId);
                 if (isset($profile)) {
                     $this->address->setProfile($profile);
                 }
             }
         }
     }
     return $this->address;
 }
예제 #2
0
 /**
  * {@inheritDoc}
  */
 public function setProfile(\XLite\Model\Profile $profile = NULL)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setProfile', array($profile));
     return parent::setProfile($profile);
 }