Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time
executable file 50 lines (39 sloc) 1.37 KB
namespace d3yii2\d3pop3\models;
use d3yii2\d3pop3\models\base\D3pop3Email as BaseD3pop3Email;
use Yii;
* This is the model class for table "d3pop3_emails".
class D3pop3Email extends BaseD3pop3Email
public const D3FILES_ALLOWED_EXT_REGEXP = '/(gif|pdf|dat|jpe?g|png|doc|docx|xls|xlsx|htm?l|txt|log|mxl|xml|zip|odt)$/i';
public function delete()
$isOtherCompanies = false;
/** @var D3pop3SendReceiv $sendReceive */
foreach (D3pop3SendReceiv::find()->where(['email_id' => $this->id])->all() as $sendReceive){
if($sendReceive->company_id !== Yii::$app->SysCmp->getActiveCompanyId()){
$isOtherCompanies = true;
/** @var D3pop3EmailAddress $address */
foreach ($this->getD3pop3EmailAddresses()->all() as $address){
/** @var D3pop3EmailModel $models */
foreach ($this->getD3pop3EmailModels()->all() as $models){
/** @var D3pop3EmailError $error */
foreach ($this->getD3pop3EmailErrors()->all() as $error){
return parent::delete();
return 1;