EShoppingCart::isEmpty PHP Method

isEmpty() public method

Returns if cart is empty
public isEmpty ( ) : boolean
return boolean
    public function isEmpty()
    {
        return !(bool) $this->getCount();
    }

Usage Example

Esempio n. 1
0
 function testEmpty()
 {
     $this->setUp();
     $cart = new EShoppingCart();
     $this->assertTrue($cart->isEmpty());
     $book = Book::model()->findByPk(1);
     $cart->put($book);
     $this->assertFalse($cart->isEmpty());
 }