| @@ 115-128 (lines=14) @@ | ||
| 112 | * |
|
| 113 | * @param \WebCMS\Entity\Page $new [description] |
|
| 114 | */ |
|
| 115 | private function setPagePath($new) |
|
| 116 | { |
|
| 117 | $path = $this->em->getRepository('WebCMS\Entity\Page')->getPath($new); |
|
| 118 | $final = array(); |
|
| 119 | foreach ($path as $p) { |
|
| 120 | if ($p->getParent() != NULL) { |
|
| 121 | $final[] = $p->getSlug(); |
|
| 122 | } |
|
| 123 | } |
|
| 124 | ||
| 125 | $new->setPath(implode('/', $final)); |
|
| 126 | ||
| 127 | return $new; |
|
| 128 | } |
|
| 129 | ||
| 130 | /** |
|
| 131 | * |
|
| @@ 196-207 (lines=12) @@ | ||
| 193 | * |
|
| 194 | * @return [type] [description] |
|
| 195 | */ |
|
| 196 | private function generatePath($page) |
|
| 197 | { |
|
| 198 | $path = $this->em->getRepository('WebCMS\Entity\Page')->getPath($page); |
|
| 199 | $final = array(); |
|
| 200 | foreach ($path as $p) { |
|
| 201 | if ($p->getParent() != NULL) { |
|
| 202 | $final[] = $p->getSlug(); |
|
| 203 | } |
|
| 204 | } |
|
| 205 | ||
| 206 | $page->setPath(implode('/', $final)); |
|
| 207 | } |
|
| 208 | ||
| 209 | /** |
|
| 210 | * |
|