Knp\Bundle\KnpBundlesBundle\Entity\Activity::getState PHP Method

getState() public method

public getState ( ) : integer
return integer
    public function getState()
    {
        return $this->state;
    }

Usage Example

 /**
  * @param Activity $activity
  * @param string   $type
  *
  * @return string
  */
 public function bundleActivityMessage(Activity $activity, $type = 'long')
 {
     switch ($activity->getType()) {
         case Activity::ACTIVITY_TYPE_COMMIT:
             return 'long' == $type ? $activity->getMessage() : 'commited into';
             break;
         case Activity::ACTIVITY_TYPE_RECOMMEND:
             return 'long' == $type ? 'Bundle was recommended' : 'recommended';
             break;
         case Activity::ACTIVITY_TYPE_TRAVIS_BUILD:
             return ('long' == $type ? 'Travis-CI build of the bundle' : 'CI build') . (Activity::STATE_OPEN == $activity->getState() ? ' passed' : ' failed');
             break;
         case Activity::ACTIVITY_TYPE_TWEETED:
             return 'long' == $type ? 'Bundle archived top trending badge' : 'archived';
             break;
         default:
             return $activity->getMessage() ?: 'Various info';
     }
 }
All Usage Examples Of Knp\Bundle\KnpBundlesBundle\Entity\Activity::getState