private function __tryToUnlockEverything() { $current_option = new Application_Model_Option_Value(); $current_option->find($this->getValueId()); if ($current_option->getId() and $current_option->getApplication()) { $application = $current_option->getApplication(); $has_another_padlock = false; foreach ($application->getOptions() as $option) { if ($option->getCode() == $current_option->getCode() and $option->getId() != $current_option->getId() and $option->getData("is_active")) { Zend_Debug::dump($current_option->getData()); Zend_Debug::dump($option->getData()); $has_another_padlock = true; } } if (!$has_another_padlock) { $this->setValueIds(array()); $application->setRequireToBeLoggedIn(0)->save(); $this->saveValueIds($application->getId()); } } }