forked from lavaeagle/lara-cart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcartify.php
59 lines (54 loc) · 1.25 KB
/
cartify.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* --------------------------------------------------------------------------
* Cartify
* --------------------------------------------------------------------------
*
* Cartify, a shopping cart bundle for use with the Laravel Framework.
*
* @package Cartify
* @version 2.1.1
* @author Bruno Gaspar <[email protected]>
* @link https://github.com/bruno-g/cartify
*/
namespace Cartify;
/**
* Cartify Exception.
*/
class CartifyException extends \Exception {}
/**
* Cartify class.
*/
class Cartify
{
/**
* Return a new Cartify_Cart() object.
*
* @access public
* @param string
* @return object
*/
public static function cart($cart_name = null)
{
// Return the cart object.
//
return new Cartify_Cart($cart_name);
}
/**
* Returns a new Cartify_Cart() object with the wishlist name.
*
* @access public
* @param string
* @return object
*/
public static function wishlist($cart_name = 'wishlist')
{
// Make sure we have a cart name.
//
$cart_name = trim($cart_name);
$cart_name = (is_null($cart_name) or $cart_name == '' ? 'wishlist' : $cart_name);
// Return the cart object.
//
return new Cartify_Cart($cart_name);
}
}