<commit_before><?php
/**
 * Tools to use API as ActiveRecord for Yii2
 *
 * @link      https://github.com/hiqdev/yii2-hiart
 * @package   yii2-hiart
 * @license   BSD-3-Clause
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
 */

namespace hiqdev\hiart;

use Yii;

/**
 * The Command class implements execution of request.
 */
class Command extends \yii\base\Component
{
    /**
     * @var AbstractConnection
     */
    public $db;

    /**
     * @var RequestInterface request object
     */
    protected $request;

    public function setRequest(RequestInterface $request)
    {
        $this->request = $request;

        return $this;
    }

    /**
     * Sends a request to retrieve data.
     * In API this could be get, search or list request.
     * @throws ResponseErrorException
     * @return mixed response data
     */
    public function search()
    {
        $this->request->getQuery()->addAction('search');

        return $this->send();
    }

    /**
     * Sends a request to create/insert data.
     * @param mixed $table entity to create
     * @param mixed $columns attributes of object to create
     * @param array $params request parameters
     * @return $this
     */
    public function insert($table, $columns, array $params = [])
    {
        $request = $this->db->getQueryBuilder()->insert($table, $columns, $params);<commit_msg>changed `Command::search`: added passing send options<commit_after><?php
/**
 * Tools to use API as ActiveRecord for Yii2
 *
 * @link      https://github.com/hiqdev/yii2-hiart
 * @package   yii2-hiart
 * @license   BSD-3-Clause
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
 */

namespace hiqdev\hiart;

use Yii;

/**
 * The Command class implements execution of request.
 */
class Command extends \yii\base\Component
{
    /**
     * @var AbstractConnection
     */
    public $db;

    /**
     * @var RequestInterface request object
     */
    protected $request;

    public function setRequest(RequestInterface $request)
    {
        $this->request = $request;

        return $this;
    }

    /**
     * Sends a request to retrieve data.
     * In API this could be get, search or list request.
     * @param array $options send options
     * @throws ResponseErrorException
     * @return mixed response data
     */
    public function search($options = [])
    {
        $this->request->getQuery()->addAction('search');

        return $this->send($options);
    }

    /**
     * Sends a request to create/insert data.
     * @param mixed $table entity to create
     * @param mixed $columns attributes of object to create
     * @param array $params request parameters
     * @return $this
     */
    public function insert($table, $columns, array $params = [])
    {
        $request = $this->db->getQueryBuilder()->insert($table, $columns, $params);
{'fraction_non_alphanumeric': 0.12574016022291884, 'fraction_numerical': 0.008359456635318705, 'mean_word_length': 2.515299877600979, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5126182', 'n_tokens_mistral': 851, 'n_tokens_neox': 827, 'n_words': 247}