Lemon\RestBundle\Object\Registry::has PHP Method

has() public method

public has ( string $name ) : boolean
$name string
return boolean
    public function has($name)
    {
        return array_key_exists($name, $this->classes);
    }

Usage Example

Example #1
0
 /**
  * @covers ::add()
  * @covers ::has()
  * @covers ::get()
  * @covers ::all()
  */
 public function testAddClass()
 {
     $definition = new Definition('person', '\\Lemon\\RestBundle\\Tests\\Fixtures\\Person');
     $registry = new Registry();
     $registry->add($definition);
     $this->assertTrue($registry->has('person'));
     $this->assertEquals('\\Lemon\\RestBundle\\Tests\\Fixtures\\Person', $registry->get('person')->getClass());
     $this->assertEquals(array('person' => $definition), $registry->all());
 }