<commit_before><?php
/**
 * @link http://netis.pl/
 * @copyright Copyright (c) 2015 Netis Sp. z o. o.
 */

namespace netis\utils\crud;

use yii\base\InvalidParamException;
use yii\db\ActiveQuery;
use yii\db\Schema;
use yii\web\IdentityInterface;

/**
 * ActiveRecord class extended with the following functionality:
 * - attached the linkable, labels and trackable behaviors by default
 * - ability to cast to string
 * - added relations() method to return list of relations
 * - added attributeFormats() to return default attribute formats
 * @package netis\utils\crud
 * @method bool isRelated(array $relations, IdentityInterface $user = null)
 * @method array getCheckedRelations()
 * @method bool saveRelations(array $data, string $formName = null)
 * @method void linkByKeys(\yii\db\ActiveQuery $relation, array $keys, array $removeKeys)
 * @method string getCrudLabel(string $operation = null)
 * @method string getRelationLabel(\yii\db\ActiveQuery $activeRelation, string $relation)
 * @method ActiveRecord loadVersion(integer $version_id)
 * @method \netis\utils\db\ActiveQuery getRelation($name, $throwException = true)
 */
class ActiveRecord extends \yii\db\ActiveRecord
{
    /**
     * The name of the create scenario.
     */
    const SCENARIO_CREATE = 'create';
    /**
     * The name of the update scenario.
     */
    const SCENARIO_UPDATE = 'update';

    /**
     * @inheritdoc<commit_msg>add AR methods from trackable behavior<commit_after><?php
/**
 * @link http://netis.pl/
 * @copyright Copyright (c) 2015 Netis Sp. z o. o.
 */

namespace netis\utils\crud;

use yii\base\InvalidParamException;
use yii\db\ActiveQuery;
use yii\db\Schema;
use yii\web\IdentityInterface;

/**
 * ActiveRecord class extended with the following functionality:
 * - attached the linkable, labels and trackable behaviors by default
 * - ability to cast to string
 * - added relations() method to return list of relations
 * - added attributeFormats() to return default attribute formats
 * @package netis\utils\crud
 * @method bool isRelated(array $relations, IdentityInterface $user = null)
 * @method array getCheckedRelations()
 * @method bool saveRelations(array $data, string $formName = null)
 * @method void linkByKeys(\yii\db\ActiveQuery $relation, array $keys, array $removeKeys)
 * @method string getCrudLabel(string $operation = null)
 * @method string getRelationLabel(\yii\db\ActiveQuery $activeRelation, string $relation)
 * @method null beginChangeset()
 * @method null endChangeset()
 * @method ActiveRecord loadVersion(integer $version_id)
 * @method \netis\utils\db\ActiveQuery getRelation($name, $throwException = true)
 */
class ActiveRecord extends \yii\db\ActiveRecord
{
    /**
     * The name of the create scenario.
     */
    const SCENARIO_CREATE = 'create';
    /**
     * The name of the update scenario.
     */
    const SCENARIO_UPDATE = 'update';

    /**
     * @inheritdoc
{'fraction_non_alphanumeric': 0.11206600206256445, 'fraction_numerical': 0.002750085940185631, 'mean_word_length': 4.052083333333333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '4080624', 'n_tokens_mistral': 861, 'n_tokens_neox': 844, 'n_words': 266}