getId() public méthode

Get the ID
public getId ( ) : integer
Résultat integer
Exemple #1
0
    /**
     * {@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;
    }
Exemple #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());
 }
Exemple #3
0
 /**
  * {@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);
 }