src/Kunstmaan/GeneratorBundle/Generator/FormPageGenerator.php
private function updateParentPages()
    {
        $phpCode = "            [\n";
        $phpCode .= "                'name' => '" . $this->entity . "',\n";
        $phpCode .= "                'class'=> '" .
            $this->bundle->getNamespace() .
            '\\Entity\\Pages\\' . $this->entity . "'\n";
        $phpCode .= '            ],'."\n        ";

        // When there is a BehatTestPage, we should also allow the new page as sub page
        $behatTestPage = $this->bundle->getPath() . '/Entity/Pages/BehatTestPage.php';
        if (file_exists($behatTestPage)) {
            $this->parentPages[] = $behatTestPage;
        }

        foreach ($this->parentPages as $file) {
            $data = file_get_contents($file);
            $data = preg_replace(
                '/(function\s*getPossibleChildTypes\s*\(\)\s*\{\s*)(return\s*\[|return\s*array\()/',
                "$1$2\n$phpCode",
                $data
            );
            file_put_contents($file, $data);
        }
    }
private function updateParentPages()
    {
        $phpCode = "            [\n";
        $phpCode .= "                'name' => '" . $this->entity . "',\n";
        $phpCode .= "                'class'=> '" .
            $this->bundle->getNamespace() .
            '\\Entity\\Pages\\' . $this->entity . "'\n";
        $phpCode .= '            ],'."\n        ";

        // When there is a BehatTestPage, we should also allow the new page as sub page
        $behatTestPage = $this->bundle->getPath() . '/Entity/Pages/BehatTestPage.php';
        if (file_exists($behatTestPage)) {
            $this->parentPages[] = $behatTestPage;
        }

        foreach ($this->parentPages as $file) {
            $data = file_get_contents($file);
            $data = preg_replace(
                '/(function\s*getPossibleChildTypes\s*\(\)\s*\{\s*)(return\s*\[|return\s*array\()/',
                "$1$2\n$phpCode",
                $data
            );
            file_put_contents($file, $data);
        }
    }
private function updateParentPages ( ) { $ phpCode = "            [\n" ; $ phpCode .= "                'name' => '" . $ this -> entity . "',\n" ; $ phpCode .= "                'class'=> '" . $ this -> bundle -> getNamespace ( ) . '\\Entity\\Pages\\' . $ this -> entity . "'\n" ; $ phpCode .= '            ],' . "\n        " ; // When there is a BehatTestPage, we should also allow the new page as sub page $ behatTestPage = $ this -> bundle -> getPath ( ) . '/Entity/Pages/BehatTestPage.php' ; if ( file_exists ( $ behatTestPage ) ) { $ this -> parentPages [ ] = $ behatTestPage ; } foreach ( $ this -> parentPages as $ file ) { $ data = file_get_contents ( $ file ) ; $ data = preg_replace ( '/(function\s*getPossibleChildTypes\s*\(\)\s*\{\s*)(return\s*\[|return\s*array\()/' , "$1$2\n$phpCode" , $ data ) ; file_put_contents ( $ file , $ data ) ; } }
Update the getPossibleChildTypes function of the parent Page classes
Update the getPossibleChildTypes function of the parent Page classes