public function setUid($uid)
    {
        if ($this->hasUid()) {
            throw new \BadMethodCallException('The UID of a model cannot be set a second time.', 1331489260);
        }
        if ($this->isVirgin()) {
            $this->setLoadStatus(self::STATUS_GHOST);
        }

        $this->uid = $uid;
    }
public function setUid($uid)
    {
        if ($this->hasUid()) {
            throw new \BadMethodCallException('The UID of a model cannot be set a second time.', 1331489260);
        }
        if ($this->isVirgin()) {
            $this->setLoadStatus(self::STATUS_GHOST);
        }

        $this->uid = $uid;
    }
public function setUid ( $ uid ) { if ( $ this -> hasUid ( ) ) { throw new \ BadMethodCallException ( 'The UID of a model cannot be set a second time.' , 1331489260 ) ; } if ( $ this -> isVirgin ( ) ) { $ this -> setLoadStatus ( self :: STATUS_GHOST ) ; } $ this -> uid = $ uid ; }
Sets this model's UID.

This function may only be called on models that do not have a UID yet.

If this function is called on an empty model, the model state is changed
to ghost.

@param int $uid the UID to set, must be > 0

@return void
Sets this model s UID .