public function testSerialization() { $storage = new AclAnnotationStorage(); $storage->add(new AclAnnotation(['id' => 'annotation', 'type' => 'entity']), 'Acme\\SomeClass', 'SomeMethod'); $this->assertEquals('annotation', $storage->findById('annotation')->getId()); $this->assertEquals('annotation', $storage->find('Acme\\SomeClass', 'SomeMethod')->getId()); $data = serialize($storage); $storage = unserialize($data); $this->assertEquals('annotation', $storage->findById('annotation')->getId()); $this->assertEquals('annotation', $storage->find('Acme\\SomeClass', 'SomeMethod')->getId()); }
/** * Gets an annotation by its id * * @param string $id * @return AclAnnotation|null AclAnnotation object or null if ACL annotation was not found */ public function findAnnotationById($id) { $this->ensureAnnotationsLoaded(); return $this->storage->findById($id); }