<commit_before><?php namespace Blindern\UKA\Billett;

use Henrist\LaravelApiQuery\ApiQueryInterface;

class Paymentgroup extends \Eloquent implements ApiQueryInterface {
    protected $model_suffix = '';
    protected $table = 'paymentgroups';

    protected $apiAllowedFields = array('id', 'eventgroup_id', 'time_start', 'time_end', 'title', 'user_created', 'user_closed');
    protected $apiAllowedRelations = array('payments', 'eventgroup', 'valid_tickets', 'revoked_tickets');

    public function payments()
    {
        return $this->hasMany('\\Blindern\\UKA\\Billett\\Payment'.$this->model_suffix, 'paymentgroup_id');
    }

    public function eventgroup()
    {
        return $this->belongsTo('\\Blindern\\UKA\\Billett\\Eventgroup'.$this->model_suffix, 'eventgroup_id');
    }

    public function valid_tickets()
    {
        // this will list tickets that was assign to this paymentgroup when it was made valid, but it might be revoked now
        return $this->belongsTo('\\Blindern\\UKA\\Billett\\Ticket'.$this->model_suffix, 'valid_paymentgroup_id');
    }

    public function revoked_tickets()
    {
        return $this->belongsTo('\\Blindern\\UKA\\Billett\\Ticket'.$this->model_suffix, 'revoked_paymentgroup_id');
    }

    /**
     * Get fields we can search in
     */
    public function getApiAllowedFields() {
        return $this->apiAllowedFields;
    }
<commit_msg>Fix relation type between paymentgroup and tickets<commit_after><?php namespace Blindern\UKA\Billett;

use Henrist\LaravelApiQuery\ApiQueryInterface;

class Paymentgroup extends \Eloquent implements ApiQueryInterface {
    protected $model_suffix = '';
    protected $table = 'paymentgroups';

    protected $apiAllowedFields = array('id', 'eventgroup_id', 'time_start', 'time_end', 'title', 'user_created', 'user_closed');
    protected $apiAllowedRelations = array('payments', 'eventgroup', 'valid_tickets', 'revoked_tickets');

    public function payments()
    {
        return $this->hasMany('\\Blindern\\UKA\\Billett\\Payment'.$this->model_suffix, 'paymentgroup_id');
    }

    public function eventgroup()
    {
        return $this->belongsTo('\\Blindern\\UKA\\Billett\\Eventgroup'.$this->model_suffix, 'eventgroup_id');
    }

    public function valid_tickets()
    {
        // this will list tickets that was assign to this paymentgroup when it was made valid, but it might be revoked now
        return $this->hasMany('\\Blindern\\UKA\\Billett\\Ticket'.$this->model_suffix, 'valid_paymentgroup_id');
    }

    public function revoked_tickets()
    {
        return $this->hasMany('\\Blindern\\UKA\\Billett\\Ticket'.$this->model_suffix, 'revoked_paymentgroup_id');
    }

    /**
     * Get fields we can search in
     */
    public function getApiAllowedFields() {
        return $this->apiAllowedFields;
    }

{'fraction_non_alphanumeric': 0.1339001062699256, 'fraction_numerical': 0.0, 'mean_word_length': 3.606851549755302, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '2624643', 'n_tokens_mistral': 862, 'n_tokens_neox': 851, 'n_words': 180}