コード例 #1
0
 /**
  * @param array $FormPostValues
  * @param bool $Insert
  * @return bool
  */
 public function Validate($FormPostValues, $Insert = FALSE)
 {
     $valid = parent::Validate($FormPostValues, $Insert);
     if (!CheckPermission('Garden.Moderation.Manage') && C('Conversations.MaxRecipients')) {
         $max = C('Conversations.MaxRecipients');
         if (isset($FormPostValues['RecipientUserID']) && count($FormPostValues['RecipientUserID']) > $max) {
             $this->Validation->AddValidationResult('To', Plural($max, "You are limited to %s recipient.", "You are limited to %s recipients."));
             $valid = false;
         }
     }
     return $valid;
 }
コード例 #2
0
 /**
  * Class constructor. Defines the related database table name.
  *
  * @since 2.0.0
  * @access public
  */
 public function __construct()
 {
     parent::__construct('Conversation');
 }
コード例 #3
0
 /**
  * {@inheritdoc}
  */
 public function getCount($wheres = [])
 {
     if (is_numeric($wheres)) {
         deprecated('ConversationModel->getCount(int, array)', 'ConversationModel->getCountInbox()');
         $args = func_get_args();
         return $this->getCountInbox($wheres, val(1, $args));
     }
     return parent::getCount();
 }