mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 12:03:14 +00:00
Refactor && Typo && Use plain objects as function parameters instead of ids
This commit is contained in:
@@ -406,7 +406,7 @@ class collection implements cache_cacheableInterface
|
||||
$stmt->execute([':base_id' => $this->get_base_id()]);
|
||||
$stmt->closeCursor();
|
||||
|
||||
$this->app['manipulator.registration']->deleteRegistrationsOnCollection($this->get_base_id());
|
||||
$this->app['manipulator.registration']->deleteRegistrationsOnCollection($this);
|
||||
|
||||
$this->get_databox()->delete_data_from_cache(databox::CACHE_COLLECTIONS);
|
||||
|
||||
@@ -534,7 +534,7 @@ class collection implements cache_cacheableInterface
|
||||
$stmt->execute($params);
|
||||
$stmt->closeCursor();
|
||||
|
||||
$this->app['manipulator.registration']->deleteRegistrationsOnCollection($this->get_base_id());
|
||||
$this->app['manipulator.registration']->deleteRegistrationsOnCollection($this);
|
||||
|
||||
phrasea::reset_baseDatas($app['phraseanet.appbox']);
|
||||
|
||||
@@ -748,17 +748,19 @@ class collection implements cache_cacheableInterface
|
||||
*/
|
||||
public function isRegistrationEnabled()
|
||||
{
|
||||
if ($xml = simplexml_load_string($this->get_prefs())) {
|
||||
$element = $xml->xpath('/baseprefs/caninscript');
|
||||
if (false === $xml = simplexml_load_string($this->get_prefs())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (count($element) === 0) {
|
||||
return $this->databox->isRegistrationEnabled();
|
||||
}
|
||||
$element = $xml->xpath('/baseprefs/caninscript');
|
||||
|
||||
foreach ($element as $caninscript) {
|
||||
if (false !== (Boolean) (string) $caninscript) {
|
||||
return true;
|
||||
}
|
||||
if (count($element) === 0) {
|
||||
return $this->databox->isRegistrationEnabled();
|
||||
}
|
||||
|
||||
foreach ($element as $caninscript) {
|
||||
if (false !== (Boolean) (string) $caninscript) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -774,12 +776,12 @@ class collection implements cache_cacheableInterface
|
||||
*/
|
||||
public function getTermsOfUse()
|
||||
{
|
||||
if ($xml = simplexml_load_string($this->get_prefs())) {
|
||||
foreach ($xml->xpath('/baseprefs/cgu') as $sbpcgu) {
|
||||
return $sbpcgu->saveXML();
|
||||
}
|
||||
if (false === $xml = simplexml_load_string($this->get_prefs())) {
|
||||
return;
|
||||
}
|
||||
|
||||
return null;
|
||||
foreach ($xml->xpath('/baseprefs/cgu') as $sbpcgu) {
|
||||
return $sbpcgu->saveXML();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user