<commit_before><?php
/**
 * Litus is a project by a group of students from the KU Leuven. The goal is to create
 * various applications to support the IT needs of student unions.
 *
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 *
 * @license http://litus.cc/LICENSE
 */

namespace FormBundle\Entity\Node\Form;

use CommonBundle\Entity\General\Language,
    CommonBundle\Entity\User\Person,
    DateTime,
    Doctrine\ORM\Mapping as ORM,
    IntlDateFormatter,
    FormBundle\Entity\Mail\Mail,
    FormBundle\Entity\Node\Entry,
    FormBundle\Entity\Node\Form as BaseForm;

/**
 * This entity stores the node item.
 *
 * @ORM\Entity(repositoryClass="FormBundle\Repository\Node\Form\Doodle")
 * @ORM\Table(name="nodes.forms_doodles")
 */
class Doodle extends BaseForm
{
    /**
     * @var boolean Flag whether the names of reservations are visible for others
     *
     * @ORM\Column(name="names_visible_for_others", type="boolean")
     */
    private $namesVisibleForOthers;

    /**
     * @var \FormBundle\Entity\Mail\Mail The mail sent for reminding.
     *
     * @ORM\OneToOne(targetEntity="FormBundle\Entity\Mail\Mail")
     * @ORM\JoinColumn(name="reminder_mail", referencedColumnName="id")
     */
    private $reminderMail;

    /**
     * @param \CommonBundle\Entity\User\Person $person
     * @param \DateTime $startDate
     * @param \DateTime $endDate
     * @param boolean $active
     * @param boolean $multiple
     * @param boolean $nonMember
     * @param boolean $editableByUser
     * @param boolean $namesVisibleForOthers
     */
    public function __construct(Person $person, DateTime $startDate, DateTime $endDate, $active, $multiple, $nonMember, $editableByUser, $namesVisibleForOthers)
    {
        parent::__construct($person, $startDate, $endDate, $active, 0, $multiple, $nonMember, $editableByUser);

        $this->namesVisibleForOthers = $namesVisibleForOthers;
    }

    /**
     * @return array
     */
    public function getFields()
    {
        $fields = array();
        foreach(parent::getFields() as $field)
            $fields[$field->getStartDate()->getTimestamp() . $field->getId()] = $field;

        ksort($fields);

        return $fields;
    }

    /**
     * @param boolean $namesVisibleForOthers
     * @return \FormBundle\Entity\Node\Form\Doodle
     */
    public function setNamesVisibleForOthers($namesVisibleForOthers)
    {
        $this->namesVisibleForOthers = $namesVisibleForOthers;
        return $this;
    }

    /**
     * @return boolean
     */
    public function getNamesVisibleForOthers()
    {
        return $this->namesVisibleForOthers;
    }

    /**
     * @return boolean
     */
    public function hasReminderMail() {
        return null !== $this->reminderMail;
    }

    /**
     * @param \FormBundle\Entity\Mail\Mail $reminderMail
     *
     * @return \FormBundle\Entity\Node\Form\Doodle
     */
    public function setReminderMail(Mail $reminderMail) {
        $this->reminderMail = $reminderMail;
        return $this;
    }

    /**
     * @return \FormBundle\Entity\Mail\Mail
     */
    public function getReminderMail() {
        return $this->reminderMail;
    }

    /**
     * @return string
     */
    public function getType()
    {
        return 'doodle';
    }

    /**
     * @param \FormBundle\Entity\Node\Entry $entry
     * @param \CommonBundle\Entity\General\Language $language
     * @return string
     */
    protected function _getSummary(Entry $entry, Language $language) {
        $fieldEntries = $this->_entityManager
            ->getRepository('FormBundle\Entity\Entry')
            ->findAllByFormEntry($entry);

        $formatterDate = new IntlDateFormatter(
            $language->getAbbrev(),
            IntlDateFormatter::NONE,
            IntlDateFormatter::NONE,
            date_default_timezone_get(),
            IntlDateFormatter::GREGORIAN,
            'd MMMM Y'
        );

        $formatterHour = new IntlDateFormatter(
            $language->getAbbrev(),
            IntlDateFormatter::NONE,
            IntlDateFormatter::NONE,
            date_default_timezone_get(),
            IntlDateFormatter::GREGORIAN,
            'H:mm'
        );

        $result = '';
        foreach ($fieldEntries as $fieldEntry) {
            $result .= $fieldEntry->getField()->getLabel($language) . PHP_EOL;
        }

        return $result;
    }
}<commit_msg>Extra information in doodle mail<commit_after><?php
/**
 * Litus is a project by a group of students from the KU Leuven. The goal is to create
 * various applications to support the IT needs of student unions.
 *
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 *
 * @license http://litus.cc/LICENSE
 */

namespace FormBundle\Entity\Node\Form;

use CommonBundle\Entity\General\Language,
    CommonBundle\Entity\User\Person,
    DateTime,
    Doctrine\ORM\Mapping as ORM,
    IntlDateFormatter,
    FormBundle\Entity\Mail\Mail,
    FormBundle\Entity\Node\Entry,
    FormBundle\Entity\Node\Form as BaseForm;

/**
 * This entity stores the node item.
 *
 * @ORM\Entity(repositoryClass="FormBundle\Repository\Node\Form\Doodle")
 * @ORM\Table(name="nodes.forms_doodles")
 */
class Doodle extends BaseForm
{
    /**
     * @var boolean Flag whether the names of reservations are visible for others
     *
     * @ORM\Column(name="names_visible_for_others", type="boolean")
     */
    private $namesVisibleForOthers;

    /**
     * @var \FormBundle\Entity\Mail\Mail The mail sent for reminding.
     *
     * @ORM\OneToOne(targetEntity="FormBundle\Entity\Mail\Mail")
     * @ORM\JoinColumn(name="reminder_mail", referencedColumnName="id")
     */
    private $reminderMail;

    /**
     * @param \CommonBundle\Entity\User\Person $person
     * @param \DateTime $startDate
     * @param \DateTime $endDate
     * @param boolean $active
     * @param boolean $multiple
     * @param boolean $nonMember
     * @param boolean $editableByUser
     * @param boolean $namesVisibleForOthers
     */
    public function __construct(Person $person, DateTime $startDate, DateTime $endDate, $active, $multiple, $nonMember, $editableByUser, $namesVisibleForOthers)
    {
        parent::__construct($person, $startDate, $endDate, $active, 0, $multiple, $nonMember, $editableByUser);

        $this->namesVisibleForOthers = $namesVisibleForOthers;
    }

    /**
     * @return array
     */
    public function getFields()
    {
        $fields = array();
        foreach(parent::getFields() as $field)
            $fields[$field->getStartDate()->getTimestamp() . $field->getId()] = $field;

        ksort($fields);

        return $fields;
    }

    /**
     * @param boolean $namesVisibleForOthers
     * @return \FormBundle\Entity\Node\Form\Doodle
     */
    public function setNamesVisibleForOthers($namesVisibleForOthers)
    {
        $this->namesVisibleForOthers = $namesVisibleForOthers;
        return $this;
    }

    /**
     * @return boolean
     */
    public function getNamesVisibleForOthers()
    {
        return $this->namesVisibleForOthers;
    }

    /**
     * @return boolean
     */
    public function hasReminderMail() {
        return null !== $this->reminderMail;
    }

    /**
     * @param \FormBundle\Entity\Mail\Mail $reminderMail
     *
     * @return \FormBundle\Entity\Node\Form\Doodle
     */
    public function setReminderMail(Mail $reminderMail) {
        $this->reminderMail = $reminderMail;
        return $this;
    }

    /**
     * @return \FormBundle\Entity\Mail\Mail
     */
    public function getReminderMail() {
        return $this->reminderMail;
    }

    /**
     * @return string
     */
    public function getType()
    {
        return 'doodle';
    }

    /**
     * @param \FormBundle\Entity\Node\Entry $entry
     * @param \CommonBundle\Entity\General\Language $language
     * @return string
     */
    protected function _getSummary(Entry $entry, Language $language) {
        $fieldEntries = $this->_entityManager
            ->getRepository('FormBundle\Entity\Entry')
            ->findAllByFormEntry($entry);

        $formatterDate = new IntlDateFormatter(
            $language->getAbbrev(),
            IntlDateFormatter::NONE,
            IntlDateFormatter::NONE,
            date_default_timezone_get(),
            IntlDateFormatter::GREGORIAN,
            'd MMMM Y'
        );

        $formatterHour = new IntlDateFormatter(
            $language->getAbbrev(),
            IntlDateFormatter::NONE,
            IntlDateFormatter::NONE,
            date_default_timezone_get(),
            IntlDateFormatter::GREGORIAN,
            'H:mm'
        );

        $result = '';
        foreach ($fieldEntries as $fieldEntry) {
            $result .= $fieldEntry->getField()->getLabel($language);

            if ($fieldEntry->getField()->getLocation($language)) {
                $result .= ': ' . $fieldEntry->getField()->getLocation($language);
            }

            if ($fieldEntry->getField()->getExtraInformation($language)) {
                $result .= PHP_EOL . '    ' . str_replace("\n", "\n    ", str_replace("\r\n", "\n", $fieldEntry->getField()->getExtraInformation($language)));
            }

            $result .= PHP_EOL;
        }

        return $result;
    }
}
{'fraction_non_alphanumeric': 0.12946428571428573, 'fraction_numerical': 0.00021258503401360543, 'mean_word_length': 2.484814814814815, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 73, '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': '3097834', 'n_tokens_mistral': 2808, 'n_tokens_neox': 2740, 'n_words': 550}