/** * Return count of sent in last period by IP address * * @param bool $increment - flag, increase count before return value * @return int */ protected function _sentCountByIp($increment = false) { $time = time(); $period = $this->_sendfriendData->getPeriod(); $websiteId = $this->_storeManager->getStore()->getWebsiteId(); if ($increment) { // delete expired logs $this->_getResource()->deleteLogsBefore($time - $period); // add new item $this->_getResource()->addSendItem($this->remoteAddress->getRemoteAddress(true), $time, $websiteId); } return $this->_getResource()->getSendCount($this, $this->remoteAddress->getRemoteAddress(true), time() - $period, $websiteId); }
/** * Retrieve Max Recipients * * @return int */ public function getMaxRecipients() { return $this->_sendfriendData->getMaxRecipients(); }