/** * Class constructor. * * @param array $options Element options * @param array $attr HTML attributes */ public function __construct(array $options = [], array $attr = []) { if (isset($options['method'])) { $attr['method'] = $options['method']; } $attr += ['method' => 'post']; if (isset($options['action'])) { $attr['action'] = $options['action']; } unset($options['method'], $options['action']); parent::__construct($options, $attr); }
/** * * Class constructor * * @param string $name * * @access public */ public function __construct($name) { parent::__construct($name); $this->setRepeating(true); $this->setSortable(true); $this->setLabel(Translate::translate('Gallery')); $name = new Text('name'); $name->setLabel(Translate::translate('Name')); $this->addControl($name); $values = new Textarea('values'); $values->setLabel(Translate::translate('Description')); $this->addControl($values); }
/** * @param string[] $fieldNames An array of field names * @param string|string[] $words An array of words or a string of whitespace or comma separated words */ public function __construct($fieldNames, $words) { $this->fieldNames = $fieldNames; $this->words = $words; if (!is_array($words)) { $words = preg_split('/[\\s,]+/', $words); } $groups = []; foreach ($words as $word) { $filters = []; foreach ($fieldNames as $fieldName) { $filters[] = new Contains($fieldName, $word); } $groups[] = new OrGroup($filters); } parent::__construct("AND", $groups); }
public function __construct($group = null) { parent::__construct($group); }
/** * Class constructor. * * @param array $options Element options * @param array $attr HTML attributes */ public function __construct(array $options = [], array $attr = []) { parent::__construct($options, $attr); }
public function __construct() { parent::__construct(0, null); }
public function __construct($id = '', $name) { parent::__construct($id); $this->name = $name; }
/** * Class constructor. * @param obj $db PDO object * @param int $sessionToken an integer saved in $_SESSION to keep the user logged in */ public function __construct($db, $sessionToken, $characterID) { /** Adding in the db object to the class */ $this->_db = $db; if ($sessionToken !== null) { /** Looking up the sessionToken within our core_sessions table */ $stmt_lookup_session_token = $db->prepare('SELECT session_token,userid,expiration_time FROM core_sessions ' . ' WHERE session_token = ? ORDER BY expiration_time DESC LIMIT 1'); $stmt_lookup_session_token->execute(array($sessionToken)); $session_information = $stmt_lookup_session_token->fetch(\PDO::FETCH_ASSOC); /** Verifying if we have a session currently active, and it is within our session timer */ if ($stmt_lookup_session_token->rowCount() == 1 && time() - $session_information['expiration_time'] <= SESSION_TIME_LIMIT) { /** Looking up the user account related to this sessionToken */ $stmt = $db->prepare('SELECT userid,username,access_level,group_id FROM user_accounts WHERE userid = ? LIMIT 1'); $stmt->execute(array($session_information['userid'])); $account_information = $stmt->fetch(\PDO::FETCH_ASSOC); /** Saving the pertinent account information to the User class object */ $this->_userID = $account_information['userid']; $this->_username = $account_information['username']; $this->_accessLevel = $account_information['access_level']; parent::__construct($account_information['group_id']); /** Getting the SSO Character information */ $stmt_sso_character_lookup = $db->prepare('SELECT character_id,corporation_id,alliance_id,key_keyid FROM ' . 'user_characters WHERE userid = ? AND character_id = ? AND sso_character = 1'); $stmt_sso_character_lookup->execute(array($this->_userID, $characterID)); $ssoCharacterInformation = $stmt_sso_character_lookup->fetch(\PDO::FETCH_ASSOC); $this->_characterID = $ssoCharacterInformation['character_id']; $this->_corporationID = $ssoCharacterInformation['corporation_id']; $this->_allianceID = $ssoCharacterInformation['alliance_id']; /** Setting our login status to TRUE */ $this->_loginStatus = true; } else { $this->_loginStatus = false; } } else { $this->_loginStatus = false; } }
public function __construct($filters = []) { parent::__construct("OR", $filters); }
/** * Creates a new GroupProfile object. * * @see Group::__construct() */ public function __construct($groupID = null, $row = null, $groupname = null, $email = null, $sqlSelects = '', $sqlJoins = '') { $this->avatarID = 0; parent::__construct($groupID, $row, $groupname, $email); }
/** * Constructor. * * @param string $documentClass The document class. * @param \Mandango\Document\AbstractDocument $parent The parent document. * @param string $field The reference field. * * @api */ public function __construct($documentClass, $parent, $field) { parent::__construct($documentClass); $this->parent = $parent; $this->field = $field; }
/** * The instance is constructed with the following defaults: * * - {@link COLUMNS}: 3. * - {@link COLUMNS_TOTAL}: 12. * * @param array $attribute */ public function __construct(array $attribute = []) { parent::__construct($attribute + [self::COLUMNS => 3, self::COLUMNS_TOTAL => 12]); }
public function __construct($columnName, $min, $max) { $this->min = $min; $this->max = $max; parent::__construct("And", [new GreaterThan($columnName, $min, true), new LessThan($columnName, $max, true)]); }