Exemplo n.º 1
0
 /**
  * @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));
 }
Exemplo n.º 3
0
 /**
  * Constructor.
  *
  * @param       RequestModel            $request     Request model
  */
 public function __construct(&$request)
 {
     // Construct the parent class
     parent::__construct($request);
     // Validate the request parameters
     $this->validateRequestParams();
 }
Exemplo n.º 4
0
 public function __construct()
 {
     parent::__construct($this->table);
     $this->addField("name", "");
     $this->request = new Request();
     $this->id = $this->request->cat;
 }
Exemplo n.º 5
0
 function init()
 {
     parent::init();
     $this->setPage(null);
     $this->addStickyArguments();
     $this->extension = $this->api->getConfig('url_postfix', $this->extension);
 }
Exemplo n.º 6
0
 /**
  * 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();
 }
Exemplo n.º 7
0
 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);
 }
Exemplo n.º 8
0
 /**
  * @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();
 }
Exemplo n.º 9
0
 /**
 		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;
 }
Exemplo n.º 10
0
 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;
 }
Exemplo n.º 11
0
 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));
 }
Exemplo n.º 14
0
 /**
  * @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]));
 }
Exemplo n.º 15
0
 public function __construct()
 {
     parent::__construct($this->table);
     $this->addField("email", "");
     $this->addField("password", "");
     $this->addField("create", "");
     $this->addField("update", "");
 }
Exemplo n.º 16
0
 public function __construct($data = null)
 {
     parent::__construct('user', 'id');
     if (!is_null($data)) {
         $this->setData($data);
         $this->setOriginData($data);
     }
 }
Exemplo n.º 17
0
 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);
 }
Exemplo n.º 18
0
 /**
  * Создаем объект для работы с базой данных.
  * @возвращаем 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;
 }
Exemplo n.º 19
0
 protected function isPossibleToRun()
 {
     if (!parent::isPossibleToRun()) {
         return false;
     }
     $params = $this->getParams();
     return $this->getHelper('Component\\Ebay\\Motors')->isMarketplaceSupportsKtype($params['marketplace_id']);
 }
Exemplo n.º 20
0
 /**
  * @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]));
 }
Exemplo n.º 21
0
 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);
     }
 }
Exemplo n.º 23
0
 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);
 }
Exemplo n.º 24
0
 /**
  * 初始化方法,如果需要,各模型必须重写此处
  * @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;
 }
Exemplo n.º 25
0
 function __clone()
 {
     parent::__clone();
     $x = unserialize(serialize($this->template));
     unset($this->template);
     $this->template = $x;
     unset($this->tags);
     $this->rebuildTags();
 }
Exemplo n.º 26
0
 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;
     }
 }
Exemplo n.º 27
0
 /**
  * @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');
 }
Exemplo n.º 28
0
 function __clone()
 {
     parent::__clone();
     foreach ($this->elements as $key => $el) {
         if (is_object($el)) {
             $this->elements[$key] = clone $el;
             $this->elements[$key]->owner = $this;
         }
     }
 }
Exemplo n.º 29
0
 /**
  * @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');
 }
Exemplo n.º 30
0
 /**
  * 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;
 }