Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 3.5.0.0
- * @ Author : DeZender
- * @ Release on : 22.06.2018
- * @ Official site : http://DeZender.Net
- *
- */
- class AppModel extends Model
- {
- use Blesta\Core\Util\Common\Traits\Container;
- private $per_page = null;
- protected $logger = null;
- protected $replacement_keys = null;
- public function __construct($db_info = null)
- {
- parent::__construct($db_info);
- Loader::loadComponents($this, array('Input', 'Record', 'Events'));
- Loader::loadHelpers($this, array('DataStructure', 'Date'));
- Language::loadLang(array('_global', '_custom'));
- $this->logger = $this->getFromContainer('logger');
- $this->replacement_keys = Configure::get('Blesta.replacement_keys');
- $this->setPerPage(Configure::get('Blesta.results_per_page'));
- }
- public function getPerPage()
- {
- return $this->per_page;
- }
- public function setPerPage($per_page)
- {
- $this->per_page = max(1, (int) $per_page);
- }
- public function currencyToDecimal($value, $currency, $decimals = null)
- {
- if (!isset($this->CurrencyFormat)) {
- Loader::loadHelpers($this, array('CurrencyFormat' => array(Configure::get('Blesta.company_id'))));
- }
- return $this->CurrencyFormat->cast($value, $currency, $decimals);
- }
- public static function truncateDecimal($value, $min, $decimal_char = '.')
- {
- $exponent = strrpos($value, $decimal_char);
- if ($exponent === false) {
- return $value;
- }
- return rtrim(str_pad(rtrim($value, '0'), $exponent + 1 + $min, '0', STR_PAD_RIGHT), $decimal_char);
- }
- public function dateToUtc($date, $format = 'Y-m-d H:i:s', $use_cur_time = false)
- {
- $dt = clone $this->Date;
- if ($use_cur_time && $dt->format('H:i:s', $date) == '00:00:00') {
- $date = $dt->format('Y-m-d', $date);
- $dt->setTimezone('UTC', Configure::get('Blesta.company_timezone'));
- $date .= ' ' . $dt->format('H:i:s');
- }
- $dt->setTimezone(Configure::get('Blesta.company_timezone'), 'UTC');
- return $dt->format($format, $date);
- }
- public function errors()
- {
- if (is_object($this->Input) && $this->Input instanceof Input) {
- return $this->Input->errors();
- ..................................................................................
- ........................................................
- .........................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement