mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-24 07:55:35 +00:00
@@ -4,31 +4,31 @@ use Illuminate\Support\Collection;
|
|||||||
|
|
||||||
class CartRowOptionsCollection extends Collection {
|
class CartRowOptionsCollection extends Collection {
|
||||||
|
|
||||||
public function __construct($items)
|
public function __construct($items)
|
||||||
{
|
{
|
||||||
parent::__construct($items);
|
parent::__construct($items);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __get($arg)
|
public function __get($arg)
|
||||||
{
|
{
|
||||||
if($this->has($arg))
|
if($this->has($arg))
|
||||||
{
|
{
|
||||||
return $this->get($arg);
|
return $this->get($arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function search(Array $search)
|
public function search(Array $search)
|
||||||
{
|
{
|
||||||
foreach($search as $key => $value)
|
foreach($search as $key => $value)
|
||||||
{
|
{
|
||||||
$found = ($this->{$key} === $value) ? true : false;
|
$found = ($this->{$key} === $value) ? true : false;
|
||||||
|
|
||||||
if( ! $found) return false;
|
if( ! $found) return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $found;
|
return $found;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user