Ejemplo n.º 1
0
 /**
  * Returns the related SilvercartAvailabilityStatus object.
  * Provides an extension hook to update the status object by decorator.
  * 
  * @return SilvercartAvailabilityStatus
  * 
  * @author Sebastian Diel <*****@*****.**>
  * @since 03.07.2014
  */
 public function SilvercartAvailabilityStatus()
 {
     if (is_null($this->cachedSilvercartAvailabilityStatus)) {
         $this->cachedSilvercartAvailabilityStatus = $this->getComponent('SilvercartAvailabilityStatus');
         $this->extend('updateSilvercartAvailabilityStatus', $this->cachedSilvercartAvailabilityStatus);
         if (!$this->cachedSilvercartAvailabilityStatus instanceof SilvercartAvailabilityStatus || !$this->cachedSilvercartAvailabilityStatus->exists()) {
             $default = SilvercartAvailabilityStatus::getDefault();
             if ($default instanceof SilvercartAvailabilityStatus && $default->exists()) {
                 $this->cachedSilvercartAvailabilityStatus = $default;
             }
         }
     }
     return $this->cachedSilvercartAvailabilityStatus;
 }