<commit_before><?php

/**
 * This file is part of the OpenPNE package.
 * (c) OpenPNE Project (http://www.openpne.jp/)
 *
 * For the full copyright and license information, please view the LICENSE
 * file and the NOTICE file that were distributed with this source code.
 */

/**
 * PluginSendMessageData
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @package    opMessagePlugin
 * @subpackage form
 */
abstract class PluginSendMessageData extends BaseSendMessageData
{
  const MESSAGE_TYPE_RECEIVE = 'receive';
  const MESSAGE_TYPE_SEND = 'send';
  const MESSAGE_TYPE_DRAFT = 'draft';
  const MESSAGE_TYPE_DUST = 'dust';

  protected
    $previous = null,
    $next = null;

  /**
   * メッセージが本人送信のものかどうか確認する
   * @param  $member_id
   * @return boolean
   */
  public function getIsSender($memberId = null)
  { 
    if (is_null($memberId))
    {
      $memberId = sfContext::getInstance()->getUser()->getMemberId();
    }
    if ($this->getMemberId() == $memberId)
    {
      return 1;
    }
    else
    {
      return 0;
    }
  }

  /**
   * メッセージが本人宛かどうか確認する
   * @param  $member_id
   * @return int
   */
  public function getIsReceiver($member_id)
  { 
    $message = Doctrine::getTable('MessageSendList')->getMessageByReferences($member_id, $this->getId());
    if ($message) {
      return 1;
    } else {
      return 0;
    }
  }

  /**
   * 宛先リストを取得する
   * @return array
   */
  public function getSendList()
  {<commit_msg>Add check parameter isSend.<commit_after><?php

/**
 * This file is part of the OpenPNE package.
 * (c) OpenPNE Project (http://www.openpne.jp/)
 *
 * For the full copyright and license information, please view the LICENSE
 * file and the NOTICE file that were distributed with this source code.
 */

/**
 * PluginSendMessageData
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @package    opMessagePlugin
 * @subpackage form
 */
abstract class PluginSendMessageData extends BaseSendMessageData
{
  const MESSAGE_TYPE_RECEIVE = 'receive';
  const MESSAGE_TYPE_SEND = 'send';
  const MESSAGE_TYPE_DRAFT = 'draft';
  const MESSAGE_TYPE_DUST = 'dust';

  protected
    $previous = null,
    $next = null;

  /**
   * メッセージが本人送信のものかどうか確認する
   * @param  $member_id
   * @return boolean
   */
  public function getIsSender($memberId = null)
  { 
    if (is_null($memberId))
    {
      $memberId = sfContext::getInstance()->getUser()->getMemberId();
    }
    if ($this->getMemberId() == $memberId)
    {
      return 1;
    }
    else
    {
      return 0;
    }
  }

  /**
   * メッセージが本人宛で且つ送信済みかどうか確認する
   * @param  $member_id
   * @return int
   */
  public function getIsReceiver($member_id)
  { 
    $message = Doctrine::getTable('MessageSendList')->getMessageByReferences($member_id, $this->getId());
    if ($message && $this->getIsSend()) {
      return 1;
    } else {
      return 0;
    }
  }

  /**
   * 宛先リストを取得する
   * @return array
   */
  public function getSendList()
  {
{'fraction_non_alphanumeric': 0.12076484401207649, 'fraction_numerical': 0.0026836632002683663, 'mean_word_length': 2.9031413612565444, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1556564', 'n_tokens_mistral': 1083, 'n_tokens_neox': 1043, 'n_words': 240}