Skip to content

Commit

Permalink
added compatible layer for mail template (refs openpne#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kousuke Ebihara committed Jan 5, 2010
1 parent 46d33da commit 30f87ed
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/view/twig/opTemplateRendererTwig.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public function accept()
$member['profile'][$v->name] = $v->getValue();
}

// for BC
$member['getRawValue'] = new opTwigDummyMemberProfile($member['id']);

$member['config'] = array();
foreach ($current->getMemberConfig() as $v)
{
Expand Down Expand Up @@ -110,3 +113,20 @@ public function doFilter()
return $data;
}
}

class opTwigDummyMemberProfile
{
protected $id;

public function __construct($id)
{
$this->id = $id;
}

public function getProfile($name)
{
$member = Doctrine::getTable('Member')->find($this->id);

return (string)$member->getProfile($name);
}
}

0 comments on commit 30f87ed

Please sign in to comment.