Exemple #1
0
 /**
  * Finds item specified by state.
  *
  * @param array $state State of the product to be found.
  * @return Product|Product\Purchasable Item found.
  */
 public function findForState(array $state)
 {
     // TODO: For simple products state and ID is exactly the same - worth to try to integrate (lower DB queries).
     $key = serialize($state);
     if (!isset($this->states[$key])) {
         $this->states[$key] = $this->service->findForState($state);
     }
     return $this->states[$key];
 }