getGroup() public method

Get the group
public getGroup ( ) : string
return string
示例#1
0
文件: XML.php 项目: imbo/imbo
    /**
     * {@inheritdoc}
     */
    public function formatAccessRule(Model\AccessRule $model)
    {
        $rule = $this->formatAccessRuleArray(['id' => $model->getId(), 'users' => $model->getUsers(), 'group' => $model->getGroup(), 'resources' => $model->getResources()]);
        return <<<RULE
<?xml version="1.0" encoding="UTF-8"?>
<imbo>
  {$rule}
</imbo>
RULE;
    }
示例#2
0
 /**
  * @covers Imbo\Model\AccessRule::getGroup
  * @covers Imbo\Model\AccessRule::setGroup
  */
 public function testSetAndGetGroup()
 {
     $this->assertNull($this->model->getGroup());
     $this->assertSame($this->model, $this->model->setGroup('name'));
     $this->assertSame('name', $this->model->getGroup());
 }
示例#3
0
文件: JSON.php 项目: imbo/imbo
 /**
  * {@inheritdoc}
  */
 public function formatAccessRule(Model\AccessRule $model)
 {
     $data = ['id' => $model->getId(), 'users' => $model->getUsers()];
     if ($group = $model->getGroup()) {
         $data['group'] = $group;
     }
     if ($resources = $model->getResources()) {
         $data['resources'] = $resources;
     }
     return $this->encode($data);
 }