Skip to content

Commit

Permalink
Fixed CS
Browse files Browse the repository at this point in the history
  • Loading branch information
willdurand committed Sep 12, 2011
1 parent b406c53 commit 58c51fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/behavior/SfPropelBehaviorI18n.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public function set{$refPhpName}ForCulture({$this->getI18nTable()->getPhpName()}
*/
public function objectFilter(&$script)
{

if (!$this->hasPrimaryString($this->getTable()) && $this->hasPrimaryString($this->getI18nTable()))
{
$foreignKey = $this->getI18nTable()->getBehavior('symfony_i18n_translation')->getForeignKey();
Expand All @@ -233,7 +233,7 @@ public function __toString()
$parser->replaceMethod('__toString', $toString);
$script = $parser->getCode();
}

$table = $this->getTable();
$i18nTable = $this->getI18nTable();
$tablePhpName = $this->getTable()->getPhpName();
Expand Down
11 changes: 5 additions & 6 deletions lib/form/sfFormPropel.class.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -89,25 +89,25 @@ public function embedI18n($cultures, $decorator = null)

$class = $this->getI18nFormClass();
foreach ($cultures as $culture)
{
{
// test if i18n Propel's methods exists
if(method_exists($this->getObject(), 'setLocale') && method_exists($this->getObject(), 'getCurrentTranslation'))
{
$this->getObject()->setLocale($culture);
$i18nObject = $this->getObject()->getCurrentTranslation();
$this->getObject()->setLocale($culture);
$i18nObject = $this->getObject()->getCurrentTranslation();
}
// else try to use SfPropelBehaviorI18n Propel's methods exists
else
{
$method = sprintf('getCurrent%s', $this->getI18nModelName());
$i18nObject = $this->getObject()->$method($culture);
}

$i18n = new $class($i18nObject);

if ($i18nObject->isNew())
{
unset($i18n['id'], $i18n['culture'], $i18n['locale']);
unset($i18n['id'], $i18n['culture'], $i18n['locale']);
}

$this->embedForm($culture, $i18n, $decorator);
Expand Down Expand Up @@ -260,7 +260,6 @@ public function saveEmbeddedForms($con = null, $forms = null)
{
if ($form instanceof sfFormObject)
{

// this is Propel specific
if(isset($form->getObject()->markForDeletion))
{
Expand Down

0 comments on commit 58c51fd

Please sign in to comment.