__construct() публичный Метод

public __construct ( $id = false, $table = null, $ds = null )
Пример #1
0
 /**
  * Optionally sets the table name and initializes the internal class
  * properties.
  *
  * @param string $table  The name of the table
  */
 public function __construct($table = null)
 {
     $this->where = new \Bistro\Data\Query\Where();
     $this->order_by = new \Bistro\Data\Query\Order();
     $this->limit = new \Bistro\Data\Query\Limit();
     parent::__construct($table);
 }
Пример #2
0
 /**
  * 析构函数
  */
 public function __construct(Connection $connection, $options)
 {
     parent::__construct($connection, $options);
     if (!empty($options['database'])) {
         $this->explainSchema($options);
     }
 }
Пример #3
0
 public function __construct(Connection $connection, $table, array $options = array())
 {
     $options['return'] = Database::RETURN_AFFECTED;
     parent::__construct($connection, $options);
     $this->table = $table;
     $this->condition = new Condition('AND');
 }
Пример #4
0
 function __construct($conn, $game, $player)
 {
     //set our connection
     parent::__construct($conn);
     $this->player = $player;
     $this->sql = "SELECT player1, player2 FROM game WHERE game_id='{$game}';";
 }
 public function __construct(Entity $searchEntity, QueryContext $queryContext, Scope $defaultScope, $id = NULL, $skipBinaries = FALSE)
 {
     parent::__construct($queryContext);
     $this->searchEntity = $searchEntity;
     $this->queryParams = $queryContext->getQueryParameters($searchEntity, $id);
     $this->propertyNames = array();
     $this->scope = $queryContext->getScope($searchEntity, $defaultScope);
     $this->skipBinaries = $skipBinaries;
     // If the scope doesn't include property values...
     if ($this->scope->includes(Scope::TAG_PROPERTIES) == Scope::INCLUDES_NONE) {
         // ...then only fetch the object id and any foreign keys.
         if ($this->searchEntity->isObjectEntity()) {
             $this->propertyNames[] = $this->searchEntity->getObjectIdColumnName();
         }
         foreach ($this->searchEntity->getRelationships() as $relationship) {
             if ($relationship->getFkEntity() != $this->searchEntity) {
                 continue;
             }
             $toEntity = $relationship->getOppositeEntity($this->searchEntity);
             $this->propertyNames[] = $relationship->getFkColumnName($toEntity);
         }
     }
     // Create the first two aliases for the table and its state.
     $this->createAlias();
     $this->createAlias();
     // Add the query parameters to the where-clause.
     foreach ($this->queryParams as $paramName => $paramValue) {
         $property = $this->searchEntity->getProperty($paramName, FALSE);
         if ($property == NULL) {
             //                error_log("Ignoring unknown query parameter: '$paramName=$paramValue'.");
         } else {
             $this->addWhereClause($paramName, $paramValue);
         }
     }
 }
Пример #6
0
 public function __construct($map, $queryType, $poly)
 {
     $_REQUEST['mode'] = 'nquery';
     parent::__construct($map);
     $this->queryType = $queryType ? $queryType : 'simple';
     $this->poly = $poly;
 }
Пример #7
0
 /**
  * Create a new instance.
  *
  * @param string $domain (optional) The Google Apps-hosted domain to use
  *          when constructing query URIs.
  * @param string $emailListName (optional) Value for the emailListName
  *          property.
  * @param string $recipient (optional) Value for the recipient
  *          property.
  * @param string $startEmailListName (optional) Value for the
  *          startEmailListName property.
  */
 public function __construct($domain = null, $emailListName = null, $recipient = null, $startEmailListName = null)
 {
     parent::__construct($domain);
     $this->setEmailListName($emailListName);
     $this->setRecipient($recipient);
     $this->setStartEmailListName($startEmailListName);
 }
Пример #8
0
 /**
  * Create a new instance.
  *
  * @param string $domain (optional) The Google Apps-hosted domain to use
  *          when constructing query URIs.
  * @param string $nickname (optional) Value for the nickname
  *          property.
  * @param string $username (optional) Value for the username
  *          property.
  * @param string $startNickname (optional) Value for the
  *          startNickname property.
  */
 public function __construct($domain = null, $nickname = null, $username = null, $startNickname = null)
 {
     parent::__construct($domain);
     $this->setNickname($nickname);
     $this->setUsername($username);
     $this->setStartNickname($startNickname);
 }
Пример #9
0
 function __construct($conn, $game)
 {
     //set our connection
     parent::__construct($conn);
     $this->game = $game;
     $this->sql = "SELECT * FROM game WHERE game_id='{$game}';";
 }
Пример #10
0
 public function __construct()
 {
     parent::__construct();
     $this->addModules([new MomentJs(), new Form(), new Button()]);
     $this->addFiles(["modules/Table/Table.min.js", "modules/Table/classes/Form.min.js", "modules/Table/Table.min.css"]);
     $this->init();
 }
Пример #11
0
 public function __construct(Type &$_typeObject)
 {
     $this->_typeObject = $_typeObject;
     $this->postType = $_typeObject->getPostType();
     $args = $_typeObject->getQueryArgs();
     parent::__construct($args, $this->postType);
 }
Пример #12
0
 function __construct()
 {
     // jalg multi 5-7-2015
     parent::__construct();
     //	function CircQuery() {
     //		$this->Query();
     $this->_loc = new Localize(OBIB_LOCALE, 'classes');
 }
 function __construct()
 {
     // jalg multi 5-7-2015
     parent::__construct();
     //  function BiblioStatusHistQuery() {
     //    $this->Query();
     $this->_loc = new Localize(OBIB_LOCALE, "classes");
 }
Пример #14
0
 public function __construct($_form = "")
 {
     parent::__construct();
     $this->form = $_form;
     $this->addfile("modules/Form/Form.min.css");
     $this->message = "I campi contrassegnati con * sono obbligatori.<br>";
     $this->tablesCached = [];
 }
 function __construct()
 {
     //jalg multi 5-7-2015
     parent::__construct();
     //  function MemberAccountQuery() {
     $this->Query();
     $this->_loc = new Localize(OBIB_LOCALE, "classes");
 }
Пример #16
0
 /**
  * Constructor.
  *
  * @param int|null $id
  * @param boolean $cached
  */
 public function __construct($id = null, $cached = true)
 {
     parent::__construct($id, $cached);
     if (!$id) {
         $this->set_use_pages(true);
         $this->set_use_alpha(false);
     }
     $this->show_header = true;
 }
 function __construct()
 {
     parent::__construct();
     if (is_null($this->_loc)) {
         //  function BiblioFieldQuery() {
         //    $this->Query();  // jalg multi 5-7-2015 ALX
         $this->_loc = new Localize(OBIB_LOCALE, "classes");
     }
 }
Пример #18
0
 function __construct()
 {
     // jalg multi 5-7-2015
     parent::__construct();
     //  function BiblioQuery() {
     //  $this->Query();
     $this->_loc = new Localize(OBIB_LOCALE, "classes");
     $this->_fieldsInBiblio = array('100a' => 'author', '245a' => 'title', '245b' => 'title_remainder', '245c' => 'responsibility_stmt', '650a' => 'topic1', '650a1' => 'topic2', '650a2' => 'topic3', '650a3' => 'topic4', '650a4' => 'topic5');
 }
 function BiblioSearchQuery()
 {
     //jalg multi 5-07-2015
     parent::__construct(OBIB_CHARSET);
     //jalg multi 5-07-2015
     //  function BiblioSearchQuery() {//jalg multi 5-07-2015
     //    $this->Query();//jalg multi 5-07-2015
     $this->_loc = new Localize(OBIB_LOCALE, "classes");
 }
Пример #20
0
 public function __construct($table, $alias = null, Connection $connection, $options = array())
 {
     $options['return'] = Database::RETURN_STATEMENT;
     parent::__construct($connection, $options);
     $conjunction = isset($options['conjunction']) ? $options['conjunction'] : 'AND';
     $this->where = new Condition($conjunction);
     $this->having = new Condition($conjunction);
     $this->addJoin(null, $table, $alias);
 }
Пример #21
0
 function __construct($conn, $game, $player, $increaseAmount)
 {
     //set our connection
     parent::__construct($conn);
     //subquery to figure out if we are increasing player 1 or player 2
     $playerNumberQuery = new PlayerNumberQuery($conn, $game, $player);
     //player number returned as number, so we can just concatenate into a string
     $playerNumber = $playerNumberQuery->getPlayerNumber();
     $this->sql = "UPDATE game \n\t\t\t\t\t\tSET player" . $playerNumber . "_score = player" . $playerNumber . "_score + {$increaseAmount}\n\t\t\t\t\t\twhere game_id={$game};";
 }
Пример #22
0
 function __construct($conn, $game)
 {
     //set our connection
     parent::__construct($conn);
     //get turn subquery
     $gameInfo = new GameInfoQuery($conn, $game);
     $turn = $gameInfo->getTurn();
     $turn = $turn == 1 ? 2 : 1;
     $this->sql = "UPDATE game \n\t\t\t\t\t\tSET turn = {$turn}\n\t\t\t\t\t\twhere game_id = {$game};";
 }
Пример #23
0
 /**
  * Creates an iterator over a database table.
  *
  * <code>
  * foreach( new Iterators\Table( array( 'table' => $wpdb->posts, 'fields' => array( 'ID', 'post_content' ) ) ) as $post ) {
  *     count_words_for( $post->ID, $post->post_content );
  * }
  * </code>
  *
  * <code>
  * foreach( new Iterators\Table( array( 'table' => $wpdb->posts, 'where' => 'ID = 8 OR post_status = "publish"' ) ) as $post ) {
  *     …
  * }
  * </code>
  *
  * <code>
  * foreach( new PostIterator( array( 'table' => $wpdb->posts, 'where' => array( 'post_status' => 'publish', 'post_date_gmt BETWEEN x AND y' ) ) ) as $post ) {
  *     …
  * }
  * </code>
  *
  *
  * @param array $args Supported arguments:
  *		table – the name of the database table
  *		fields – an array of columns to get from the table, '*' is a valid value and the default
  *		where – conditions for filtering rows. Supports two formats:
  *			= string – this will be the where clause
  *			= array – each element is treated as a condition if it's positional, or as column => value if
  *				it's a key/value pair. In the latter case the value is automatically quoted and escaped
  *      append - add arbitrary extra SQL
  */
 function __construct($args = array())
 {
     $defaults = array('fields' => '*', 'where' => array(), 'append' => '', 'table' => null, 'chunk_size' => 500);
     $table = $args['table'];
     $args = array_merge($defaults, $args);
     $fields = self::build_fields($args['fields']);
     $conditions = self::build_where_conditions($args['where']);
     $where_sql = $conditions ? " WHERE {$conditions}" : '';
     $query = "SELECT {$fields} FROM `{$table}` {$where_sql} {$args['append']}";
     parent::__construct($query, $args['chunk_size']);
 }
Пример #24
0
 function __construct($conn, $game, $dice)
 {
     //set our connection
     parent::__construct($conn);
     $this->sql = "UPDATE game \n\t\t\t\t\t\tSET ";
     for ($i = 1; $i <= 6; $i++) {
         $this->sql .= "dice{$i} = " . $dice[$i - 1] . ", ";
     }
     //remove trailing comma
     $this->sql = substr($this->sql, 0, -2) . " where game_id = {$game};";
 }
Пример #25
0
 function __construct()
 {
     // Debug - Classname ausgeben?!
     $this->debugInitOnLoad('Class', $this->getClassName(false));
     parent::__construct();
     // TODO Objekt-Handling optimieren! Aktuell werden viele Objekte doppelt erzeugt!
     // Erzeuge Datenbank und passende dazu Query - Objekt
     if (!is_object($this->gCoreDB)) {
         $this->gCoreDB = new MySQLDB();
         $this->gCoreQuery = new Query();
     }
 }
Пример #26
0
 public function __construct(Conn $conn)
 {
     parent::__construct($conn);
     $schema_file = APPLICATION_PATH . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . 'schema.xml';
     $this->setCommand('$schema');
     if (file_exists($schema_file)) {
         $this->setRawResult(file_get_contents($schema_file));
     } else {
         $rawSchema = $this->getRawResult();
         file_put_contents($schema_file, $rawSchema);
     }
     return $this;
 }
Пример #27
0
 /**
  * Constructor. Initializes actions and loads parent constructor.
  */
 protected function __construct()
 {
     parent::__construct();
     /**
      * Applies filters 'the_seo_framework_load_options' : Boolean Allows the options page to be removed
      * @since 2.2.2
      */
     $this->load_options = (bool) apply_filters('the_seo_framework_load_options', true);
     /**
      * Applies filters 'the_seo_framework_use_object_cache' : bool
      * @since 2.4.3
      */
     $this->use_object_cache = (bool) apply_filters('the_seo_framework_use_object_cache', true);
     add_action('init', array($this, 'init_the_seo_framework'), 1);
 }
Пример #28
0
 /**
  * Constructor
  *
  */
 public function __construct($keywords)
 {
     parent::__construct('');
     $this->configuration = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['suggest.'];
     if (!empty($this->configuration['treatMultipleTermsAsSingleTerm'])) {
         $this->prefix = $this->escape($keywords);
     } else {
         $matches = array();
         preg_match('/^(:?(.* |))([^ ]+)$/', $keywords, $matches);
         $fullKeywords = trim($matches[2]);
         $partialKeyword = trim($matches[3]);
         $this->setKeywords($fullKeywords);
         $this->prefix = $this->escape($partialKeyword);
     }
     $this->setAlternativeQuery('*:*');
 }
Пример #29
0
 public function __construct($_parameters = ["app" => null, "page" => null])
 {
     parent::__construct();
     $this->data["template"] = "";
     $this->tags["brand"] = "";
     $this->tags["brandImg"] = "";
     $this->tags["menu"] = "";
     $this->tags["title"] = "";
     $this->tags["subtitle"] = "";
     $this->tags["content"] = "";
     $this->tags["outContent"] = "";
     $this->tags["footer"] = "";
     $this->tags["pagePath"] = [];
     $this->tags["css"] = [];
     $this->tags["js"] = [];
     $this->tags["jsVariables"] = [];
     $this->tags["metaDescription"] = [];
     $this->tags["metaKeywords"] = [];
     $this->tags["metaAuthor"] = [];
     $this->parameters = $_parameters;
     $this->tags["base"] = $_parameters["app"]->server["RELATIVE"] . "/";
 }
Пример #30
0
 /**
  * Constructor.
  * @param string $modelClass the model class associated with this query
  * @param array $config configurations to be applied to the newly created query object
  */
 public function __construct($modelClass, $config = [])
 {
     $this->modelClass = $modelClass;
     parent::__construct($config);
 }