getResources() public method

Get the resources
public getResources ( ) : string[]
return string[]
Example #1
0
File: XML.php Project: 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;
    }
Example #2
0
 /**
  * @covers Imbo\Model\AccessRule::getResources
  * @covers Imbo\Model\AccessRule::setResources
  */
 public function testSetAndGetResources()
 {
     $this->assertSame([], $this->model->getResources());
     $this->assertSame($this->model, $this->model->setResources(['r1', 'r2']));
     $this->assertSame(['r1', 'r2'], $this->model->getResources());
 }
Example #3
0
File: JSON.php Project: 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);
 }