* Chainable.
*
* @param array $condition
- * @param array $order An optional array with order information
- * @param int|array $limit Optional limit information
- *
+ * @param array $params
* @return BaseCollection
* @throws \Exception
*/
- public function select(array $condition = [], array $order = [], $limit = null)
+ public function select(array $condition = [], array $params = [])
{
- $models = $this->selectModels($condition, $order, $limit);
+ $models = $this->selectModels($condition, $params);
return new static::$collection_class($models);
}
* Chainable.
*
* @param array $condition
- * @param array $order
+ * @param array $params
* @param int? $max_id
* @param int? $since_id
* @param int $limit
- *
* @return BaseCollection
* @throws \Exception
*/
- public function selectByBoundaries(array $condition = [], array $order = [], int $max_id = null, int $since_id = null, int $limit = self::LIMIT)
+ public function selectByBoundaries(array $condition = [], array $params = [], int $max_id = null, int $since_id = null, int $limit = self::LIMIT)
{
$condition = DBA::collapseCondition($condition);
$boundCondition[] = $since_id;
}
- $models = $this->selectModels($boundCondition, $order, $limit);
+ $params['limit'] = $limit;
+
+ $models = $this->selectModels($boundCondition, $params);
$totalCount = DBA::count(static::$table_name, $condition);
/**
* @param array $condition Query condition
- * @param array $order An optional array with order information
- * @param int|array $limit Optional limit information
- *
+ * @param array $params Additional query parameters
* @return BaseModel[]
* @throws \Exception
*/
- protected function selectModels(array $condition, array $order = [], $limit = null)
+ protected function selectModels(array $condition, array $params = [])
{
- $params = [];
-
- if (!empty($order)) {
- $params['order'] = $order;
- }
-
- if (!empty($limit)) {
- $params['limit'] = $limit;
- }
-
$result = $this->dba->select(static::$table_name, [], $condition, $params);
/** @var BaseModel $prototype */
/**
* @param array $condition
- * @param array $order An optional array with order information
- * @param int|array $limit Optional limit information
- *
+ * @param array $params
* @return Collection\Introductions
* @throws \Exception
*/
- public function select(array $condition = [], array $order = [], $limit = null)
+ public function select(array $condition = [], array $params = [])
{
- return parent::select($condition, $order, $limit);
+ return parent::select($condition, $params);
}
/**
* @param array $condition
- * @param array $order
+ * @param array $params
* @param int|null $max_id
* @param int|null $since_id
- * @param int|array $limit
+ * @param int $limit
* @return Collection\Introductions
* @throws \Exception
*/
- public function selectByBoundaries(array $condition = [], array $order = [], int $max_id = null, int $since_id = null, int $limit = self::LIMIT)
+ public function selectByBoundaries(array $condition = [], array $params = [], int $max_id = null, int $since_id = null, int $limit = self::LIMIT)
{
- return parent::selectByBoundaries($condition, $order, $max_id, $since_id, $limit);
+ return parent::selectByBoundaries($condition, $params, $max_id, $since_id, $limit);
}
}
/**
* @param array $condition
- * @param array $order An optional array with order information
- * @param int|array $limit Optional limit information
- *
+ * @param array $params
* @return Collection\PermissionSets
* @throws \Exception
*/
- public function select(array $condition = [], array $order = [], $limit = null)
+ public function select(array $condition = [], array $params = [])
{
- return parent::select($condition, $order, $limit);
+ return parent::select($condition, $params);
}
/**
* @param array $condition
- * @param array $order
+ * @param array $params
* @param int|null $max_id
* @param int|null $since_id
- * @param int|array $limit
+ * @param int $limit
* @return Collection\PermissionSets
* @throws \Exception
*/
- public function selectByBoundaries(array $condition = [], array $order = [], int $max_id = null, int $since_id = null, int $limit = self::LIMIT)
+ public function selectByBoundaries(array $condition = [], array $params = [], int $max_id = null, int $since_id = null, int $limit = self::LIMIT)
{
- return parent::selectByBoundaries($condition, $order, $max_id, $since_id, $limit);
+ return parent::selectByBoundaries($condition, $params, $max_id, $since_id, $limit);
}
/**