public function add()
 {
     if ($this->validate()) {
         $organization = new Organizations();
         $organization->official_name = $this->official_name;
         $organization->nice_name = $this->nice_name;
         $organization->cyr_name = $this->cyr_name;
         $organization->overdraft_limit = $this->overdraft;
         $organization->outbalance_limit = $this->outbalance;
         $organization->ratio = $this->ratio;
         $logo_file = UploadedFile::getInstance($this, 'logo');
         if ($logo_file) {
             $file_name = $logo_file->baseName . '.' . $logo_file->extension;
             $organization->logo = $file_name;
         }
         if ($organization->save()) {
             if ($logo_file) {
                 $folder_path = Yii::$app->params['org_img_path'] . '/' . $organization->id;
                 mkdir($folder_path);
                 $logo_file->saveAs($folder_path . '/' . $file_name);
             }
             $this->addOwnersRelations($organization->id);
             return true;
         }
     }
     return false;
 }
 public function edit(Organizations $org)
 {
     $org->official_name = $this->official_name;
     $org->nice_name = $this->nice_name;
     $org->cyr_name = $this->cyr_name;
     $org->outbalance_limit = $this->outbalance;
     $org->overdraft_limit = $this->overdraft;
     $org->ratio = $this->ratio;
     return $org->save();
 }