Skip to content

Instantly share code, notes, and snippets.

@odino
Created September 21, 2010 13:37
Show Gist options
  • Save odino/589693 to your computer and use it in GitHub Desktop.
Save odino/589693 to your computer and use it in GitHub Desktop.
class sfGuardUser extends PluginsfGuardUser
{
public function save(Doctrine_Connection $conn = null)
{
if (get_class($this) != 'sfGuardUser')
{
$name = $this->native_group;
$native_group = $this->getNativeGroup($name);
$this->link('Groups', $native_group->id);
}
parent::save($conn);
}
@odracci
Copy link

odracci commented Sep 21, 2010

class sfGuardUser extends PluginsfGuardUser {
    public function save(Doctrine_Connection $conn = null)
    {
        if ($this->isAmico())
        {
        $name = $this->native_group;
        $native_group = $this->getNativeGroup($name);
        $this->link('Groups', $native_group->id);
        }

        parent::save($conn);
    }
    protected function isAmico() {
        return false;
    }
}
class sfGuardUserAmico extends sfGuardUser {
    protected function isAmico() {
        return true;
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment