getId() public method

Get the ID
public getId ( ) : integer
return integer
Esempio n. 1
0
File: XML.php Progetto: 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;
    }
Esempio n. 2
0
 /**
  * @covers Imbo\Model\AccessRule::getId
  * @covers Imbo\Model\AccessRule::setId
  */
 public function testSetAndGetId()
 {
     $this->assertNull($this->model->getId());
     $this->assertSame($this->model, $this->model->setId(1));
     $this->assertSame(1, $this->model->getId());
 }
Esempio n. 3
0
File: JSON.php Progetto: 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);
 }