<commit_before><?php

/*
* Model for tax workshop
*/

namespace Goteo\Model;

use Goteo\Application\Exception\ModelNotFoundException;
use Goteo\Application\Lang;
use Goteo\Application\Config;
use Goteo\Model\Workshop\WorkshopSponsor;
use Goteo\Model\Workshop\WorkshopLocation;
use Goteo\Model\Blog\Post as GeneralPost;


class Workshop extends \Goteo\Core\Model {

    public
    $id,
    $title,
    $subtitle,
    $online,
    $blockquote,
    $type,
    $description,
    $date_in,
    $date_out,
    $schedule,
    $url,
    $header_image,
    $venue,
    $city,
    $venue_address,
    $how_to_get,
    $map_iframe,
    $schedule_file_url,
    $call_id,
    $workshop_location,
    $lang,
    $modified;


    public function __construct() {
        $args = func_get_args();
        call_user_func_array(array('parent', '__construct'), $args);

        if(empty($this->lang)) $this->lang = Config::get('sql_lang');
    }

    public static function getLangFields() {
        return ['title', 'subtitle', 'blockquote', 'description'];
    }

    /**
     * Get data about a workshop
     *
     * @param   int    $id         workshop id.
     * @return  Workshop object
     */
    static public function get($id, $lang = null) {

        if(!$lang) $lang = Lang::current();
        list($fields, $joins) = self::getLangsSQLJoins($lang, Config::get('sql_lang'));

        $sql="SELECT
                    workshop.id,
                    workshop.online,
                    workshop.date_in,
                    workshop.date_out,
                    workshop.schedule,
                    $fields,
                    workshop.url,
                    workshop.call_id,
                    workshop.venue,
                    workshop.city,
                    workshop.venue_address
              FROM workshop
              $joins
              WHERE workshop.id = ?";
              <commit_msg>Add schedule in workshop as lang field<commit_after><?php

/*
* Model for tax workshop
*/

namespace Goteo\Model;

use Goteo\Application\Exception\ModelNotFoundException;
use Goteo\Application\Lang;
use Goteo\Application\Config;
use Goteo\Model\Workshop\WorkshopSponsor;
use Goteo\Model\Workshop\WorkshopLocation;
use Goteo\Model\Blog\Post as GeneralPost;


class Workshop extends \Goteo\Core\Model {

    public
    $id,
    $title,
    $subtitle,
    $online,
    $blockquote,
    $type,
    $description,
    $date_in,
    $date_out,
    $schedule,
    $url,
    $header_image,
    $venue,
    $city,
    $venue_address,
    $how_to_get,
    $map_iframe,
    $schedule_file_url,
    $call_id,
    $workshop_location,
    $lang,
    $modified;


    public function __construct() {
        $args = func_get_args();
        call_user_func_array(array('parent', '__construct'), $args);

        if(empty($this->lang)) $this->lang = Config::get('sql_lang');
    }

    public static function getLangFields() {
        return ['title', 'subtitle', 'blockquote', 'description', 'schedule'];
    }

    /**
     * Get data about a workshop
     *
     * @param   int    $id         workshop id.
     * @return  Workshop object
     */
    static public function get($id, $lang = null) {

        if(!$lang) $lang = Lang::current();
        list($fields, $joins) = self::getLangsSQLJoins($lang, Config::get('sql_lang'));

        $sql="SELECT
                    workshop.id,
                    workshop.online,
                    workshop.date_in,
                    workshop.date_out,
                    $fields,
                    workshop.url,
                    workshop.call_id,
                    workshop.venue,
                    workshop.city,
                    workshop.venue_address
              FROM workshop
              $joins
              WHERE workshop.id = ?";
              
{'fraction_non_alphanumeric': 0.11540483701366983, 'fraction_numerical': 0.0, 'mean_word_length': 1.865210843373494, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2202055', 'n_tokens_mistral': 1163, 'n_tokens_neox': 1138, 'n_words': 228}