Newscoop\Entity\User::getAttributes PHP Method

getAttributes() public method

Get all user attributes
public getAttributes ( ) : array
return array of all user attributes
    public function getAttributes()
    {
        return array_filter($this->getRawAttributes());
    }

Usage Example

Beispiel #1
0
 public function testDeleteActive()
 {
     $this->user->setActive(true);
     $this->em->persist($this->user);
     $this->em->flush();
     $this->user->addAttribute('tic', 'toc');
     $this->em->persist($this->user);
     $this->em->flush();
     $this->assertTrue($this->user->isActive());
     $this->auth->expects($this->once())->method('getIdentity')->will($this->returnValue(3));
     sleep(2);
     // for testing difference in create/update time
     $this->service->delete($this->user);
     $this->assertFalse($this->user->isActive());
     $this->assertFalse($this->user->isPublic());
     $this->assertFalse($this->user->isAdmin());
     $this->assertEmpty($this->user->getEmail());
     $this->assertEmpty($this->user->getFirstName());
     $this->assertEmpty($this->user->getLastName());
     $this->assertEmpty($this->user->getAttribute('tic'));
     $this->assertEmpty($this->user->getAttributes());
     $this->assertGreaterThan($this->user->getCreated()->getTimestamp(), $this->user->getUpdated()->getTimestamp());
 }
All Usage Examples Of Newscoop\Entity\User::getAttributes