getId() public method

Get id
public getId ( ) : integer
return integer $id
Beispiel #1
0
 /**
  * Test constructor.
  *
  * @covers Application\Sonata\UserBundle\Entity\User::__construct()
  */
 public function testConstruct()
 {
     $this->object = new UserEntity();
     $this->assertNull($this->object->getId());
     $this->assertInstanceOf('Doctrine\\Common\\Collections\\ArrayCollection', $this->object->getOwnedAnnuaires());
     $this->assertEquals(0, $this->object->getOwnedAnnuaires()->count());
     $this->assertInstanceOf('Doctrine\\Common\\Collections\\ArrayCollection', $this->object->getOwnedSites());
     $this->assertEquals(0, $this->object->getOwnedSites()->count());
 }
Beispiel #2
0
 /**
  * Test User->__construct().
  */
 public function testConstruct()
 {
     $this->user = new UserEntity();
     $this->assertNull($this->user->getId());
     $this->assertTrue($this->user->getPersonnages() instanceof Collection);
     $this->assertEquals(0, $this->user->getPersonnages()->count());
     $this->assertTrue($this->user->getSites() instanceof Collection);
     $this->assertEquals(0, $this->user->getSites()->count());
     $this->assertTrue($this->user->getSitesProposes() instanceof Collection);
     $this->assertEquals(0, $this->user->getSitesProposes()->count());
     $this->assertTrue($this->user->getSitesAnalyses() instanceof Collection);
     $this->assertEquals(0, $this->user->getSitesAnalyses()->count());
 }
 /**
  * {@inheritDoc}
  */
 public function getId()
 {
     if ($this->__isInitialized__ === false) {
         return (int) parent::getId();
     }
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getId', array());
     return parent::getId();
 }
 /**
  * 
  * @param UserDrawGeometries $usergeometries
  * @param array $req_params
  * @param User $user
  * @param string $icon_path
  * @return UserDrawGeometries
  */
 private function moveuploadedMarkerIcon(UserDrawGeometries $usergeometries, array $req_params, User $user, $icon_path)
 {
     if ($req_params['upload_marker_icon']) {
         if (!file_exists($icon_path . "/" . $user->getId())) {
             mkdir($icon_path . "/" . $user->getId(), 0755, true);
         }
         move_uploaded_file($req_params['upload_marker_icon']->getPathname(), $icon_path . "/" . $user->getId() . "/" . $req_params['upload_marker_icon']->getClientOriginalName());
         $selected_marker = $user->getId() . "/" . $req_params['upload_sldfile']->getClientOriginalName();
         $usergeometries->setMarkerIcon($selected_marker);
     } else {
         if (isset($req_params['selected_marker'])) {
             $usergeometries->setMarkerIcon($req_params['selected_marker']);
         }
     }
     return $usergeometries;
 }