add some phpdoc
This commit is contained in:
@@ -166,7 +166,6 @@ abstract class AbstractSeoCrudController extends AbstractCrudController
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
// Error (Default: false)
|
||||
$error_msg = false;
|
||||
|
||||
|
||||
@@ -27,6 +27,11 @@ class Admin extends BaseAdmin implements UserInterface
|
||||
{
|
||||
use ModelEventDispatcherTrait;
|
||||
|
||||
/**
|
||||
* Retrieve all permissions for the current admin
|
||||
*
|
||||
* @return array|string
|
||||
*/
|
||||
public function getPermissions()
|
||||
{
|
||||
$profileId = $this->getProfileId();
|
||||
@@ -105,7 +110,7 @@ class Admin extends BaseAdmin implements UserInterface
|
||||
*/
|
||||
public function eraseCredentials()
|
||||
{
|
||||
$this->setPassword(null);
|
||||
parent::setPassword(null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\AreaDeliveryModule as BaseAreaDeliveryModule;
|
||||
|
||||
class AreaDeliveryModule extends BaseAreaDeliveryModule
|
||||
class AreaDeliveryModule extends BaseAreaDeliveryModule
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,13 @@ use Thelia\Model\Base\Cart as BaseCart;
|
||||
|
||||
class Cart extends BaseCart
|
||||
{
|
||||
/**
|
||||
* Duplicate the current existing cart. Only the token is changed
|
||||
*
|
||||
* @param $token
|
||||
* @param Customer $customer
|
||||
* @return Cart
|
||||
*/
|
||||
public function duplicate($token, Customer $customer = null)
|
||||
{
|
||||
$cartItems = $this->getCartItems();
|
||||
@@ -62,6 +69,11 @@ class Cart extends BaseCart
|
||||
return $cart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the last item added in the cart
|
||||
*
|
||||
* @return CartItem
|
||||
*/
|
||||
public function getLastCartItemAdded()
|
||||
{
|
||||
return CartItemQuery::create()
|
||||
@@ -71,6 +83,18 @@ class Cart extends BaseCart
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Retrieve the total taxed amount.
|
||||
*
|
||||
* By default, the total include the discount
|
||||
*
|
||||
* /!\ The postage amount is not available so it's the total with or without discount an without postage
|
||||
*
|
||||
* @param Country $country
|
||||
* @param bool $discount
|
||||
* @return float|int
|
||||
*/
|
||||
public function getTaxedAmount(Country $country, $discount = true)
|
||||
{
|
||||
$total = 0;
|
||||
@@ -86,7 +110,13 @@ class Cart extends BaseCart
|
||||
return $total;
|
||||
}
|
||||
|
||||
public function getTotalAmount()
|
||||
/**
|
||||
*
|
||||
* @see getTaxedAmount same as this method but the amount is without taxes
|
||||
* @param bool $discount
|
||||
* @return float|int
|
||||
*/
|
||||
public function getTotalAmount($discount = true)
|
||||
{
|
||||
$total = 0;
|
||||
|
||||
@@ -97,11 +127,18 @@ class Cart extends BaseCart
|
||||
$total += $subtotal;
|
||||
}
|
||||
|
||||
$total -= $this->getDiscount();
|
||||
if ($discount) {
|
||||
$total -= $this->getDiscount();
|
||||
}
|
||||
|
||||
return $total;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the total weight for all products in cart
|
||||
*
|
||||
* @return float|int
|
||||
*/
|
||||
public function getWeight()
|
||||
{
|
||||
$weight = 0;
|
||||
|
||||
@@ -36,6 +36,8 @@ class Category extends BaseCategory
|
||||
*
|
||||
* count all products for current category and sub categories
|
||||
*
|
||||
* /!\ the number of queries is exponential, use it with caution
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function countAllProducts()
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\CategoryImageI18n as BaseCategoryImageI18n;
|
||||
|
||||
class CategoryImageI18n extends BaseCategoryImageI18n
|
||||
class CategoryImageI18n extends BaseCategoryImageI18n
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,16 @@ class ConfigQuery extends BaseConfigQuery
|
||||
{
|
||||
protected static $cache = array();
|
||||
|
||||
/**
|
||||
*
|
||||
* Find a config variable and return the value or default value if not founded.
|
||||
*
|
||||
* Use this method for better performance, a cache is created for each variable already searched
|
||||
*
|
||||
* @param $search
|
||||
* @param null $default
|
||||
* @return mixed
|
||||
*/
|
||||
public static function read($search, $default = null)
|
||||
{
|
||||
if (array_key_exists($search, self::$cache)) {
|
||||
|
||||
@@ -16,6 +16,14 @@ class Country extends BaseCountry
|
||||
{
|
||||
use \Thelia\Model\Tools\ModelEventDispatcherTrait;
|
||||
|
||||
/**
|
||||
*
|
||||
* Put the current country as the default one.
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
* @throws \Exception
|
||||
* @throws \Propel\Runtime\Exception\PropelException
|
||||
*/
|
||||
public function toggleDefault()
|
||||
{
|
||||
if ($this->getId() === null) {
|
||||
|
||||
@@ -212,7 +212,7 @@ class Customer extends BaseCustomer implements UserInterface
|
||||
*/
|
||||
public function eraseCredentials()
|
||||
{
|
||||
$this->setPassword(null);
|
||||
parent::setPassword(null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -48,9 +48,12 @@ class Order extends BaseOrder
|
||||
/**
|
||||
* Compute this order amount.
|
||||
*
|
||||
* @param float $tax (output only) returns the tax amount for this order
|
||||
* @param bool $includePostage if true, the postage cost is included to the total
|
||||
* @param bool $includeDiscount if true, the discount will be included to the total
|
||||
* The order amount amount is only avaible once the order is persisted in database.
|
||||
* Duting invoice process, use all cart methods instead of order methods (the order doest not exists at this moment)
|
||||
*
|
||||
* @param float|int $tax (output only) returns the tax amount for this order
|
||||
* @param bool $includePostage if true, the postage cost is included to the total
|
||||
* @param bool $includeDiscount if true, the discount will be included to the total
|
||||
* @return float
|
||||
*/
|
||||
public function getTotalAmount(&$tax = 0, $includePostage = true, $includeDiscount = true)
|
||||
|
||||
Reference in New Issue
Block a user