Files
LaravelShoppingcart/src/Gloudemans/Shoppingcart/CartRowOptionsCollection.php
Edwin eb641093da Convert spaces to tabs.
Signed-off-by: Edwin <tkaw220@gmail.com>
2013-07-05 10:01:47 +08:00

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;
}
}