public function setStatus($id, $status)
    {
        if (!is_numeric($status)) {
            throw new Exception('Status argument must be an integer');
        }

        $entity = $this->findById($id)->firstOrFail();
        $entity->status = $status;
        $this->save($entity);

        return $entity;
    }
public function setStatus($id, $status)
    {
        if (!is_numeric($status)) {
            throw new Exception('Status argument must be an integer');
        }

        $entity = $this->findById($id)->firstOrFail();
        $entity->status = $status;
        $this->save($entity);

        return $entity;
    }
public function setStatus ( $ id , $ status ) { if ( ! is_numeric ( $ status ) ) { throw new Exception ( 'Status argument must be an integer' ) ; } $ entity = $ this -> findById ( $ id ) -> firstOrFail ( ) ; $ entity -> status = $ status ; $ this -> save ( $ entity ) ; return $ entity ; }
Set token status.

@param int $id Token id
@param int $status Token status
@return bool|\Cake\ORM\Entity
Set token status .