Knp\Bundle\KnpBundlesBundle\Entity\Bundle::getStatusHash PHP Method

getStatusHash() public method

Unique string which shows current status of the bundle
public getStatusHash ( ) : string
return string
    public function getStatusHash()
    {
        $statusFields = array('description' => $this->getDescription(), 'nbFollowers' => $this->getNbFollowers(), 'nbForks' => $this->getNbForks(), 'lastCommitAt' => $this->getLastCommitAt()->getTimestamp(), 'readme' => $this->getReadme());
        return md5(serialize($statusFields));
    }

Usage Example

Example #1
0
 /**
  * @test
  */
 public function shouldNotHaveChangesWithOnlyChangedScore()
 {
     $bundle = new Bundle('knplabs/KnpMenuBundle');
     $bundle->setScore(1000);
     $bundle->setReadme('readme number one');
     $bundle->setLastCommitAt(new \DateTime('-10 day'));
     $bundle->setNbFollowers(100);
     $bundle->setNbForks(10);
     $beforeChange = $bundle->getStatusHash();
     $bundle->setScore(1100);
     $afterChange = $bundle->getStatusHash();
     $this->assertEquals($beforeChange, $afterChange);
 }
All Usage Examples Of Knp\Bundle\KnpBundlesBundle\Entity\Bundle::getStatusHash