/** * Checks, whether a table has a Doctrine_Template_I18n-based template. * * @author Jakub Argasiński <*****@*****.**> * @param Doctrine_Table $table */ protected function _hasI18nTemplate(Doctrine_Table $table) { if ($table->hasTemplate('Doctrine_Template_I18n')) { return true; } $templates = $table->getTemplates(); foreach ($templates as $template) { if (is_subclass_of($template, 'Doctrine_Template_I18n')) { return true; } } return false; }
/** * Checks if passed modified is a SoftDelete "deleted_at" column * * @param array $modified * @param Doctrine_Table $table * @return boolean */ protected function isModifiedIsASoftDeleteColumn($modified, Doctrine_Table $table) { # When SoftDelete behavior saves "deleted" object # do not update object version on when "deleted" object is saving if ($table->hasTemplate('SoftDelete')) { $softDeleteTemplate = $table->getTemplate('SoftDelete'); $deleteAtField = $softDeleteTemplate->getOption('name'); # skip if SoftDelete sets deleted_at field if (in_array($deleteAtField, $modified)) { return true; } } return false; }