/** * @param AbstractModel $model * @param null $arg unused * @param boolean $bool indicates whether to use section tag or not * @return mixed */ public function visit(AbstractModel $model, $arg, $bool) { if (array_key_exists('style', $model->config)) { Head::getInstance()->link($model->config['style']); } return $model->accept($this, $arg, $bool); }
public function __construct($paramId = NULL, $paramIsCreateRecordsetInDatabaseIfKeyDoesntExist = AbstractModel::DEFAULT_IS_CREATE_RECORDSET_IN_DATABASE_IF_KEY_DOESNT_EXIST) { parent::__construct($paramId, $paramIsCreateRecordsetInDatabaseIfKeyDoesntExist); //Tables filles $this->setModelFta(new FtaModel($this->getDataField(self::FIELDNAME_ID_FTA)->getFieldValue(), DatabaseRecord::VALUE_DONT_CREATE_RECORD_IN_DATABASE_IF_KEY_DOESNT_EXIST)); $this->setModelFtaChapitre(new FtaChapitreModel($this->getDataField(self::FIELDNAME_ID_FTA_CHAPITRE)->getFieldValue(), DatabaseRecord::VALUE_DONT_CREATE_RECORD_IN_DATABASE_IF_KEY_DOESNT_EXIST)); }
/** * Constructor. * * @param RequestModel $request Request model */ public function __construct(&$request) { // Construct the parent class parent::__construct($request); // Validate the request parameters $this->validateRequestParams(); }
public function __construct() { parent::__construct($this->table); $this->addField("name", ""); $this->request = new Request(); $this->id = $this->request->cat; }
function init() { parent::init(); $this->setPage(null); $this->addStickyArguments(); $this->extension = $this->api->getConfig('url_postfix', $this->extension); }
/** * Deletes a invoice and all * the associated items. * * @return bool */ public function delete() { // Delete the items $this->item()->delete(); // Delete the invoice return parent::delete(); }
function init() { parent::init(); $this->soap = new SoapClient($this->owner->url, array('trace' => true, 'exceptions' => true)); $this->set('ApiKey', $this->owner->key); $this->set('ClientID', $this->owner->client); }
/** * @return bool */ protected function intervalIsLocked() { if ($this->getInitiator() == \Ess\M2ePro\Helper\Data::INITIATOR_USER || $this->getInitiator() == \Ess\M2ePro\Helper\Data::INITIATOR_DEVELOPER) { return false; } return parent::intervalIsLocked(); }
/** Returns the array of file extensions that are to be ignored during a directory scan. \returns RTArray */ public function excludeExtensions() { if (self::$_excludeExtensions == null) { self::$_excludeExtensions = Settings::sharedSettings()->objectForKey("exclude_extensions"); } return self::$_excludeExtensions; }
public static function getAllBidbyId($id) { $select = new SelectPDO(); $select->from("bid", ["bid.*", "lot.title", "user.first_name", "user.last_Name"])->where("`bid`.`lot_id` = ?", array($id))->join("lot", "lot_id", "id")->join("user", "user_id", "id"); $data = AbstractModel::getOnComplexQuery($select); return $data; }
function init() { parent::init(); if (method_exists($this, 'defineFields')) { throw $this->exception('model->defineField() is obsolete. Change to init()', 'Obsolete')->addMoreInfo('class', get_class($this)); } }
public function __construct($paramId = NULL, $paramIsCreateRecordsetInDatabaseIfKeyDoesntExist = AbstractModel::DEFAULT_IS_CREATE_RECORDSET_IN_DATABASE_IF_KEY_DOESNT_EXIST) { parent::__construct($paramId, $paramIsCreateRecordsetInDatabaseIfKeyDoesntExist); $this->setModelFtaWorkflow(new FtaWorkflowModel($this->getDataField(self::FIELDNAME_ID_FTA_WORKFLOW)->getFieldValue(), DatabaseRecord::VALUE_DONT_CREATE_RECORD_IN_DATABASE_IF_KEY_DOESNT_EXIST)); $this->setModelFtaRole(new FtaRoleModel($this->getDataField(self::FIELDNAME_ID_FTA_ROLE)->getFieldValue(), DatabaseRecord::VALUE_DONT_CREATE_RECORD_IN_DATABASE_IF_KEY_DOESNT_EXIST)); $this->setModelFtaProcessus(new FtaProcessusModel($this->getDataField(self::FIELDNAME_ID_FTA_PROCESSUS)->getFieldValue(), DatabaseRecord::VALUE_DONT_CREATE_RECORD_IN_DATABASE_IF_KEY_DOESNT_EXIST)); $this->setModelFtaChapitre(new FtaChapitreModel($this->getDataField(self::FIELDNAME_ID_FTA_CHAPITRE)->getFieldValue(), DatabaseRecord::VALUE_DONT_CREATE_RECORD_IN_DATABASE_IF_KEY_DOESNT_EXIST)); }
public function __construct($paramId = NULL, $paramIsCreateRecordsetInDatabaseIfKeyDoesntExist = AbstractModel::DEFAULT_IS_CREATE_RECORDSET_IN_DATABASE_IF_KEY_DOESNT_EXIST) { parent::__construct($paramId, $paramIsCreateRecordsetInDatabaseIfKeyDoesntExist); $this->setModelProcessusInit(new FtaProcessusModel($this->getDataField(self::FIELDNAME_PROCESSUS_INIT)->getFieldValue(), DatabaseRecord::VALUE_DONT_CREATE_RECORD_IN_DATABASE_IF_KEY_DOESNT_EXIST)); $this->setModelProcessusNext(new FtaProcessusModel($this->getDataField(self::FIELDNAME_PROCESSUS_NEXT)->getFieldValue(), DatabaseRecord::VALUE_DONT_CREATE_RECORD_IN_DATABASE_IF_KEY_DOESNT_EXIST)); $this->setModelFtaEtat(new FtaEtatModel($this->getDataField(self::FIELDNAME_FTA_ETAT)->getFieldValue(), DatabaseRecord::VALUE_DONT_CREATE_RECORD_IN_DATABASE_IF_KEY_DOESNT_EXIST)); $this->setModelFtaWorkflowModel(new FtaWorkflowModel($this->getDataField(self::FIELDNAME_WORKFLOW)->getFieldValue(), DatabaseRecord::VALUE_DONT_CREATE_RECORD_IN_DATABASE_IF_KEY_DOESNT_EXIST)); }
/** * @param int $numeroDiretoria * Uma das constantes {@link Diretoria}::DIRETORIA_* * * @throws Exception */ public function __construct($numeroDiretoria) { $numeroDiretoria = (int) $numeroDiretoria; if (!isset(self::$diretorias[$numeroDiretoria])) { throw new Exception('Não existe uma diretoria de número "' . $numeroDiretoria . '".'); } parent::__construct(array('numero' => $numeroDiretoria, 'sigla' => self::$diretorias[$numeroDiretoria][0], 'nome' => self::$diretorias[$numeroDiretoria][1])); }
public function __construct() { parent::__construct($this->table); $this->addField("email", ""); $this->addField("password", ""); $this->addField("create", ""); $this->addField("update", ""); }
public function __construct($data = null) { parent::__construct('user', 'id'); if (!is_null($data)) { $this->setData($data); $this->setOriginData($data); } }
public function __construct(\WebPay\WebPay $client, array $data) { if (array_key_exists('data', $data) && !empty($data['data'])) { $converter = $this->dataToObjectConverter($client); $data['data'] = array_map($converter, $data['data']); } parent::__construct($data); }
/** * Создаем объект для работы с базой данных. * @возвращаем object. */ public static function getDb() { if (empty(self::$dbd)) { $config = Config::$db; self::$dbd = new PDO('mysql:host=' . $config['host'] . ';dbname=' . $config['db'] . ';charset=UTF8', $config['login'], $config['password'], array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES UTF8')); } return self::$dbd; }
protected function isPossibleToRun() { if (!parent::isPossibleToRun()) { return false; } $params = $this->getParams(); return $this->getHelper('Component\\Ebay\\Motors')->isMarketplaceSupportsKtype($params['marketplace_id']); }
/** * @param int $serviceCode * One of the constants {@link ServicoDePostagem}::SERVICE_* * * @throws Exception */ public function __construct($serviceCode) { if (!isset(self::$services[$serviceCode])) { throw new Exception('There is no service with the code "' . $serviceCode . '".'); } $service = self::$services[$serviceCode]; parent::__construct(array('codigo' => $serviceCode, 'nome' => $service[0], 'idServico' => $service[1])); }
public function intro() { $articles = AbstractModel::all(); foreach ($articles as $article) { $article->intro = substr($article->content, 0, 17); } return $articles; }
/** * Extend default constructor to provide setFromObject * @param mixed $data */ public function __construct($data = array()) { if (is_object($data)) { $this->setFromObject($data); } else { parent::__construct($data); } }
public function __construct(\WebPay\WebPay $client, array $data) { if (array_key_exists('object', $data)) { $converter = $this->dataToObjectConverter($client); $data['object'] = $converter($data['object']); } parent::__construct($data); }
/** * 初始化方法,如果需要,各模型必须重写此处 * @param int|array 如果是整数, 赋值给对象的id,如果是数组, 给对象的逐个属性赋值 * @return Article对象 */ public static function instance($p_data = null) { $_o = parent::instanceModel(__CLASS__, $p_data); $tmpVars = get_object_vars($_o); $tmpVars['snapshot'] = ''; $_o->snapshot = $tmpVars; //初始化完成后,记录当前状态 return $_o; }
function __clone() { parent::__clone(); $x = unserialize(serialize($this->template)); unset($this->template); $this->template = $x; unset($this->tags); $this->rebuildTags(); }
public static function initSessionConfig() { if (false == self::$sessionInited) { $dir = APP_PATH . '/runtime/session'; \Zend_Session::setOptions(array('name' => 'sid', 'use_only_cookies' => true, 'use_cookies' => true, 'cookie_lifetime' => 90 * 86400, 'gc_maxlifetime' => 30 * 86400, 'save_path' => $dir, 'save_handler' => 'files', 'cookie_domain' => Dispatcher::getInstance()->getRequest()->getServer('HTTP_HOST'))); ini_set('session.use_strict_mode', false); self::$sessionInited = true; } }
/** * @ignore */ public function __construct($raw) { parent::__construct($raw); $this->autonomousSystemNumber = $this->get('autonomous_system_number'); $this->autonomousSystemOrganization = $this->get('autonomous_system_organization'); $this->isp = $this->get('isp'); $this->organization = $this->get('organization'); $this->ipAddress = $this->get('ip_address'); }
function __clone() { parent::__clone(); foreach ($this->elements as $key => $el) { if (is_object($el)) { $this->elements[$key] = clone $el; $this->elements[$key]->owner = $this; } } }
/** * @ignore */ public function __construct($raw) { parent::__construct($raw); $this->isAnonymous = $this->get('is_anonymous'); $this->isAnonymousVpn = $this->get('is_anonymous_vpn'); $this->isHostingProvider = $this->get('is_hosting_provider'); $this->isPublicProxy = $this->get('is_public_proxy'); $this->isTorExitNode = $this->get('is_tor_exit_node'); $this->ipAddress = $this->get('ip_address'); }
/** * Return this object with client-facing fields and hypermedia, ready for output */ public function getOutputView(Request $request, $verbose = false) { $item = parent::getOutputView($request, $verbose); // add Hypermedia $base = $request->base; $version = $request->version; $item['uri'] = $base . '/' . $version . '/twitter/request_tokens/' . $this->ID; $item['verbose_uri'] = $base . '/' . $version . '/twitter/request_tokens/' . $this->ID . '?verbose=yes'; return $item; }