本文整理汇总了PHP中Search::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Search::__construct方法的具体用法?PHP Search::__construct怎么用?PHP Search::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Search
的用法示例。
在下文中一共展示了Search::__construct方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(array $config)
{
parent::__construct($config);
Kohana::load(Kohana::find_file('vendors', 'sphinxapi'));
$this->_client = new SphinxClient();
$this->_client->SetServer($this->config('host'), $this->config('port'));
}
示例2: __construct
/**
* Rewrite construct to init some debug parameters.
*/
protected function __construct($profile)
{
$sphinx_config = parent::__construct($profile);
// Init Debug:
$this->query_debug['current_query'] = 0;
$this->query_debug = array_merge($this->query_debug, $sphinx_config);
}
示例3: __construct
/**
* __construct function.
*
* @access public
* @param int $id
* @return void
*/
public function __construct($modelId)
{
$result = Database::select('albums', '*', "id={$modelId}");
$this->record = $result->fetchAssoc();
if (!$this->record) {
header("HTTP/1.0 404 Not Found");
throw new \Exception("Album #" . intval($modelId) . " not found.");
}
parent::__construct($this->record['term']);
}
示例4: __construct
/**
* SearchConfig constructor.
* @param array $config The parsed configuration for this search
*/
public function __construct($config)
{
parent::__construct();
// setup schemas and columns
if (!empty($config['schemas'])) {
foreach ($config['schemas'] as $schema) {
$this->addSchema($schema[0], $schema[1]);
}
}
if (!empty($config['cols'])) {
foreach ($config['cols'] as $col) {
$this->addColumn($col);
}
}
// cache flag setting
$this->cacheFlag = self::$CACHE_DEFAULT;
if (!empty($config['filters'])) {
$this->cacheFlag = $this->determineCacheFlag($config['filters']);
}
// apply dynamic paramters
$this->dynamicParameters = new SearchConfigParameters($this);
$config = $this->dynamicParameters->updateConfig($config);
// configure search from configuration
if (!empty($config['filter'])) {
foreach ($config['filter'] as $filter) {
$this->addFilter($filter[0], $this->applyFilterVars($filter[2]), $filter[1], $filter[3]);
}
}
if (!empty($config['sort'])) {
foreach ($config['sort'] as $sort) {
$this->addSort($sort[0], $sort[1]);
}
}
if (!empty($config['limit'])) {
$this->setLimit($config['limit']);
}
if (!empty($config['offset'])) {
$this->setOffset($config['offset']);
}
$this->config = $config;
}
示例5: OAuthConsumer
function __construct()
{
parent::__construct();
$this->consumer = new OAuthConsumer("dj0yJmk9SlhmUUg0d2xZeElpJmQ9WVdrOWNtaERNM0pUTnpJbWNHbzlNVGM0TXpreE1ESTJNZy0tJnM9Y29uc3VtZXJzZWNyZXQmeD1lMQ--", "3dc05893bab0fc05cbcff4c10c3da27d1a21140d");
}
示例6: __construct
public function __construct($subject, $constraints)
{
parent::__construct($subject, $constraints);
$this->db->orderby('name', 'asc');
}
示例7: __construct
public function __construct($query)
{
parent::__construct($query);
}
示例8: __construct
/**
* Constructor, load parent constructor.
* Initalizes columns and load post states.
*/
protected function __construct()
{
parent::__construct();
}
示例9: __construct
/**
* __construct function.
*
* @access public
* @param string $path (default: '/')
* @return void
*/
public function __construct($path)
{
parent::__construct();
$this->path = '/' . trim($path, '/');
$this->id = $path;
}
示例10: __construct
public function __construct($constraints)
{
parent::__construct('papers', $constraints);
$this->db->orderby('name', 'asc');
}