public function beforeSave($insert) { if (!parent::beforeSave($insert)) { return false; } list($sourceWidth, $sourceHeight) = getimagesize($this->fileInfo->filePath); $this->width = $sourceWidth; $this->height = $sourceHeight; return $this->generateThumb(); }
public function beforeSave($insert) { if (parent::beforeSave($insert)) { if ($this->isNewRecord) { $this->authKey = \Yii::$app->security->generateRandomString(); } return true; } return false; }