Knp\Bundle\KnpBundlesBundle\Features\Context\FeatureContext::theSiteHasFollowingOrganizations PHP Метод

theSiteHasFollowingOrganizations() публичный Метод

public theSiteHasFollowingOrganizations ( Behat\Gherkin\Node\TableNode $table )
$table Behat\Gherkin\Node\TableNode
    public function theSiteHasFollowingOrganizations(TableNode $table)
    {
        $entityManager = $this->getEntityManager();
        $this->organizations = array();
        foreach ($table->getHash() as $row) {
            $organization = new Entity\Organization();
            $organization->fromArray(array('name' => $row['name'], 'score' => isset($row['score']) ? $row['score'] : 0));
            $entityManager->persist($organization);
            $this->organizations[$organization->getName()] = $organization;
        }
        $entityManager->flush();
    }