本文整理汇总了PHP中AbstractQuery::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractQuery::__construct方法的具体用法?PHP AbstractQuery::__construct怎么用?PHP AbstractQuery::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbstractQuery
的用法示例。
在下文中一共展示了AbstractQuery::__construct方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function __construct(Database $db, $into)
{
parent::__construct($db);
$this->_table = str_replace($this->getGraveAccent(), '', $into);
// TODO null check on $into
return $this;
}
示例2: foreach
function __construct(Database $db, array $fields = null)
{
parent::__construct($db);
foreach ($fields as $field) {
$this->_fields[] = str_replace($this->getGraveAccent(), '', $field);
// add the field to the array of fields, remove any `s for the field name
}
return $this;
}
示例3: __construct
/**
* @param string|Table|null $table
* @param string|array|Column[] $cols
*/
public function __construct($table = null, $cols = array(Column::ALL))
{
parent::__construct();
if ($table) {
$this->setTable($table);
}
if (count($cols)) {
$this->setColumns($cols);
}
}
示例4: __construct
/**
* Constructor.
*
* @param string optional $query SPARQL query string to initialize this instance.
*/
public function __construct($query = '')
{
parent::__construct($query);
if (null === $this->query) {
return;
}
$parts = array('select' => array(), 'from' => array(), 'from_named' => array(), 'where' => array(), 'order' => array(), 'limit' => array(), 'offset' => array());
// regex for variables
$var = '[?$]{1}[\\w\\d]+';
$tokens = array('select' => '/(' . '((SELECT(\\s)+)(DISTINCT(\\s)+)' . '?(COUNT(\\s)*(\\(.*?\\)(\\s)))?)(\\?\\w+\\s+|\\*)*' . '(\\(LANG\\(\\?[a-zA-Z0-9\\_]+\\)\\)* as{1}\\s\\?[a-zA-Z0-9\\_]+)*' . ')/si', 'from' => '/FROM\\s+<(.+?)>/i', 'from_named' => '/FROM\\s+NAMED\\s+<(.+?)>/i', 'where' => '/(WHERE\\s+)?\\{.*\\}/si', 'order' => '/ORDER\\s+BY((\\s+' . $var . '|\\s+(ASC|DESC)\\s*\\(\\s*' . $var . '\\s*\\))+)/i', 'limit' => '/LIMIT\\s+(\\d+)/i', 'offset' => '/OFFSET\\s+(\\d+)/i');
foreach ($tokens as $key => $pattern) {
preg_match_all($pattern, $query, $parts[$key]);
}
if (isset($parts['select'][0][0])) {
$this->queryParts['select'] = trim($parts['select'][0][0]);
}
/**
* FROM
*/
if (isset($parts['from'][1][0])) {
$this->queryParts['graphs'] = $parts['from'][1];
}
/**
* FROM NAMED
*/
if (isset($parts['from_named'][1][0])) {
$this->queryParts['named_graphs'] = $parts['from_named'][1];
}
/**
* WHERE
*/
if (isset($parts['where'][0][0])) {
$this->queryParts['where'] = $parts['where'][0][0];
}
/**
* ORDER BY
*/
if (isset($parts['order'][1][0])) {
$this->queryParts['order'] = trim($parts['order'][1][0]);
}
/**
* LIMIT
*/
if (isset($parts['limit'][1][0])) {
$this->queryParts['limit'] = $parts['limit'][1][0];
}
/**
* OFFSET
*/
if (isset($parts['offset'][1][0])) {
$this->queryParts['offset'] = $parts['offset'][1][0];
}
}
示例5: __construct
public function __construct(&$doorGets = null)
{
parent::__construct($doorGets);
}
示例6:
function __construct(Database $db, $table)
{
parent::__construct($db);
$this->_table = $table;
return $this;
}
示例7:
function __construct(Database $db)
{
parent::__construct($db);
return $this;
}
示例8: __construct
/**
* @param \PDO $pdo
* @param string $tableName
*/
public function __construct(\PDO $pdo, $tableName)
{
parent::__construct($pdo, $tableName, $this->sql);
}
示例9: __construct
/**
* @param object|string $class_name
* @param string[] $indices
*/
public function __construct($class_name, array $indices = [])
{
parent::__construct($class_name);
$this->indices = $indices;
}
示例10: __construct
/**
* @param \SolrInputDocument $document
*/
public function __construct(\SolrInputDocument $document)
{
parent::__construct();
$this->document = $document;
}
示例11: __construct
/**
* Initializes a new instance of the <tt>NativeQuery</tt> class that is bound
* to the given EntityManager.
*
* @param EntityManager $em
*/
public function __construct(EntityManager $em)
{
parent::__construct($em);
}