mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-19 05:45:20 +00:00
34 lines
514 B
PHP
34 lines
514 B
PHP
<?php namespace Gloudemans\Shoppingcart;
|
|
|
|
use Illuminate\Support\Collection;
|
|
|
|
class CartRowOptionsCollection extends Collection {
|
|
|
|
public function __construct($items)
|
|
{
|
|
parent::__construct($items);
|
|
}
|
|
|
|
public function __get($arg)
|
|
{
|
|
if($this->has($arg))
|
|
{
|
|
return $this->get($arg);
|
|
}
|
|
|
|
return NULL;
|
|
}
|
|
|
|
public function search(Array $search)
|
|
{
|
|
foreach($search as $key => $value)
|
|
{
|
|
$found = ($this->{$key} === $value) ? true : false;
|
|
|
|
if( ! $found) return false;
|
|
}
|
|
|
|
return $found;
|
|
}
|
|
|
|
} |