<commit_before><?php

namespace Group\Model;

use Eva\Api,
    Eva\Mvc\Model\AbstractModel;

class Group extends AbstractModel
{
    protected $itemTableName = 'Group\DbTable\Groups';

    protected $userList;

    public function setUserList($userList)
    {
        $this->userList = $userList;
        return $this;
    }

    public function getUserList($itemParams = array(), array $map = array())
    {
        if($this->userList){
            return $this->userList;
        }

        if(!Api::_()->isModuleLoaded('User')){
            return array();
        }

        $itemList = $this->getItemList();
        $idArray = array();

        foreach($itemList as $item){
            $idArray[] = $item['user_id'];
        }

        $userModel = Api::_()->getModel('User\Model\User');
        if(!$idArray){
            $itemParams['noResult'] = true;
        } else {
            $itemParams['id'] = $idArray;
        }
        $userModel->setItemList($itemParams);
        $userList = $userModel->getUserList($map);
        return $this->userList = $userList;
    }


    public function getGroup($groupIdOrUrlName = null, array $map = array())
    {
        $this->trigger('get.precache');

        if(is_numeric($groupIdOrUrlName)){
            $this->setItem(array(
                'id' => $groupIdOrUrlName,
            ));
        } elseif(is_string($groupIdOrUrlName)) {
            $this->setItem(array(
                'urlName' => $groupIdOrUrlName,
            ));
        }
        $this->trigger('get.pre');

        $item = $this->getItem();
        if($map){
            $item = $item->toArray($map);
        } else {
            $item = $item->self(array('*'));
        }

        $this->trigger('get');

        $this->trigger('get.group');
        $this->trigger('get.groupcache');<commit_msg>group<commit_after><?php

namespace Group\Model;

use Eva\Api,
    Eva\Mvc\Model\AbstractModel;

class Group extends AbstractModel
{
    protected $itemTableName = 'Group\DbTable\Groups';

    protected $userList;

    public function setUserList($userList)
    {
        $this->userList = $userList;
        return $this;
    }

    public function getUserList($itemParams = array(), array $map = array())
    {
        if($this->userList){
            return $this->userList;
        }

        if(!Api::_()->isModuleLoaded('User')){
            return array();
        }

        $itemList = $this->getItemList();
        $idArray = array();

        foreach($itemList as $item){
            $idArray[] = $item['user_id'];
        }

        $userModel = Api::_()->getModel('User\Model\User');
        if(!$idArray){
            $itemParams['noResult'] = true;
        } else {
            $itemParams['id'] = $idArray;
        }
        $userModel->setItemList($itemParams);
        $userList = $userModel->getUserList($map);
        return $this->userList = $userList;
    }


    public function getGroup($groupIdOrUrlName = null, array $map = array())
    {
        $this->trigger('get.precache');

        if(is_numeric($groupIdOrUrlName)){
            $this->setItem(array(
                'id' => $groupIdOrUrlName,
            ));
        } elseif(is_string($groupIdOrUrlName)) {
            $this->setItem(array(
                'groupKey' => $groupIdOrUrlName,
            ));
        }
        $this->trigger('get.pre');

        $item = $this->getItem();
        if($map){
            $item = $item->toArray($map);
        } else {
            $item = $item->self(array('*'));
        }

        $this->trigger('get');

        $this->trigger('get.group');
        $this->trigger('get.groupcache');
{'fraction_non_alphanumeric': 0.16515276630883569, 'fraction_numerical': 0.0, 'mean_word_length': 1.966530612244898, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, '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': '1673845', 'n_tokens_mistral': 1097, 'n_tokens_neox': 1074, 'n_words': 171}