/** * @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; }
/** * Class constructor. Defines the related database table name. * * @since 2.0.0 * @access public */ public function __construct() { parent::__construct('Conversation'); }
/** * {@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(); }