Pimcore\Model\Redirect\Listing::getRedirects PHP Method

getRedirects() public method

public getRedirects ( ) : array
return array
    public function getRedirects()
    {
        return $this->redirects;
    }

Usage Example

Example #1
0
 /**
  * @throws \Exception
  */
 public function delete()
 {
     if ($this->getId() == 1) {
         throw new \Exception("root-node cannot be deleted");
     }
     // check for redirects pointing to this document, and delete them too
     $redirects = new Redirect\Listing();
     $redirects->setCondition("target = ?", $this->getId());
     $redirects->load();
     foreach ($redirects->getRedirects() as $redirect) {
         $redirect->delete();
     }
     parent::delete();
 }
All Usage Examples Of Pimcore\Model\Redirect\Listing::getRedirects