public function getParameter($sName)
 {
     $sParam = parent::getParameter($sName);
     if ($sName === 'tag_instance_model' && $sParam === '') {
         $sParam = parent::getParameter('tag_model') . 'Instance';
     }
     return $sParam;
 }
 public function testParameters()
 {
     $b = new Behavior();
     $this->assertEquals($b->getParameters(), array(), 'Behavior parameters is an empty array by default');
     $b->addParameter(array('name' => 'foo', 'value' => 'bar'));
     $this->assertEquals($b->getParameters(), array('foo' => 'bar'), 'addParameter() sets a parameter from an associative array');
     $b->addParameter(array('name' => 'foo2', 'value' => 'bar2'));
     $this->assertEquals($b->getParameters(), array('foo' => 'bar', 'foo2' => 'bar2'), 'addParameter() adds a parameter from an associative array');
     $b->addParameter(array('name' => 'foo', 'value' => 'bar3'));
     $this->assertEquals($b->getParameters(), array('foo' => 'bar3', 'foo2' => 'bar2'), 'addParameter() changes a parameter from an associative array');
     $this->assertEquals($b->getParameter('foo'), 'bar3', 'getParameter() retrieves a parameter value by name');
     $b->setParameters(array('foo3' => 'bar3', 'foo4' => 'bar4'));
     $this->assertEquals($b->getParameters(), array('foo3' => 'bar3', 'foo4' => 'bar4'), 'setParameters() changes the whole parameter array');
 }
 public function getParameter($sName)
 {
     $sParam = parent::getParameter($sName);
     if ($sName === 'mode' && $sParam === '') {
         $sParam = parent::getParameter('role_key') ? 'by_role' : 'allow';
     }
     if ($sName === 'owner_allowed' && $sParam === '') {
         $sParam = $this->getParameter('mode') === 'by_role' ? 'by_role' : 'false';
     }
     if ($sName === 'role_key' && $sParam === '') {
         $sParam = $this->getTable()->getCommonName();
     }
     return $sParam;
 }