-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete directory after delete all images #68
Delete directory after delete all images #68
Conversation
@@ -223,6 +222,27 @@ public function getFilePath($imageId, $version = 'original') | |||
return $this->directory . '/' . $this->getFileName($imageId, $version); | |||
} | |||
|
|||
public function getDirectoryPath() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be private?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO This functional can be use outside widget for build the path to galery folder of model
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also we can redefine it in children
@@ -314,6 +348,9 @@ function ($image) use (&$removed) { | |||
} | |||
); | |||
} | |||
if (is_null($this->_images)) { | |||
$this->removeDirectory($this->getDirectoryPath()); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not correct - is_null($this->_images)
means only that getImages()
method was not called yet
Nested of #65
Fix #67
NOTE: This new behavior with remove folder MUST have a line on changelog.