Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler Class Reference

The Location Handler interface defines operations on Location elements in the storage engine. More...

Inheritance diagram for eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler:

## Public Member Functions
| __construct (LocationHandler $locationHandler, LocationGateway $locationGateway, LocationMapper $locationMapper, ContentHandler $contentHandler)
| Construct from userGateway. More...
| loadTrashItem ($id)
| Loads the data for the trashed location identified by $id. More...
| trashSubtree ($locationId)
| Sends a subtree starting to $locationId to the trash and returns a Trashed object corresponding to $locationId. More...
| recover ($trashedId, $newParentId)
| Returns a trashed location to normal state. More...
| findTrashItems (Criterion $criterion=null, $offset=0, $limit=null, array $sort=null)
  | {Returns all trashed locations satisfying the $criterion (if provided), sorted with $sort (if any).If no criterion is provided (null), no filter is applied.TrashResult->totalCount will ignore limit and offset and representing the total amount of trashed items matching the criterion. Parameters
  \eZ\Publish\API\Repository\Values\Content\Query\Criterion | $criterion |
  int | $offset | Offset to start listing from, 0 by default
  int | $limit | Limit for the listing. Null by default (no limit)
  \eZ\Publish\API\Repository\Values\Content\Query\SortClause[] | $sort |
Returns \eZ\Publish\SPI\Persistence\Content\Location\Trashed[]|\eZ\Publish\SPI\Persistence\Content\Location\Trash\TrashResult }. More...
| emptyTrash ()
| {Empties the trash Everything contained in the trash must be removed. Returns \eZ\Publish\API\Repository\Values\Content\Trash\TrashItemDeleteResultList } More...
| deleteTrashItem ($trashedId)
| Removes a trashed location identified by $trashedLocationId from trash Associated content has to be deleted. More...

## Protected Member Functions
| delete (Trashed $trashItem)
| Triggers delete operations for $trashItem. More...

## Protected Attributes
| $locationHandler
| $locationGateway
| $locationMapper
| $contentHandler

## Private Attributes
const | EMPTY_TRASH_BULK_SIZE = 100

## Detailed Description

The Location Handler interface defines operations on Location elements in the storage engine.

Definition at line 23 of file Core/Persistence/Legacy/Content/Location/Trash/Handler.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::__construct | ( | LocationHandler | $locationHandler,
|  | LocationGateway | $locationGateway,
|  | LocationMapper | $locationMapper,
|  | ContentHandler | $contentHandler
| ) |  |

Construct from userGateway.

Parameters

  \eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler | $locationHandler |
  \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway | $locationGateway |
  \eZ\Publish\Core\Persistence\Legacy\Content\Location\Mapper | $locationMapper |
  \eZ\Publish\Core\Persistence\Legacy\Content\Handler | $contentHandler |

Returns
  \eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler

Definition at line 65 of file Core/Persistence/Legacy/Content/Location/Trash/Handler.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler\$contentHandler, eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler\$locationGateway, eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler\$locationHandler, and eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler\$locationMapper.

## Member Function Documentation

## ◆ delete()

eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::delete | ( | Trashed | $trashItem | ) |
| protected

Triggers delete operations for $trashItem.

If there is no more locations for corresponding content, then it will be deleted as well.

Parameters

  \eZ\Publish\SPI\Persistence\Content\Location\Trashed | $trashItem |

Returns
  \eZ\Publish\API\Repository\Values\Content\Trash\TrashItemDeleteResult

Definition at line 238 of file Core/Persistence/Legacy/Content/Location/Trash/Handler.php.

## ◆ deleteTrashItem()

eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::deleteTrashItem | ( |  | $trashedId | ) |

Removes a trashed location identified by $trashedLocationId from trash Associated content has to be deleted.

Parameters

  int | $trashedId |

Returns
  \eZ\Publish\API\Repository\Values\Content\Trash\TrashItemDeleteResult

Implements eZ\Publish\SPI\Persistence\Content\Location\Trash\Handler.

Definition at line 225 of file Core/Persistence/Legacy/Content/Location/Trash/Handler.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler\loadTrashItem().

## ◆ emptyTrash()

eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::emptyTrash | ( |  | ) |

{Empties the trash Everything contained in the trash must be removed.

Returns
  \eZ\Publish\API\Repository\Values\Content\Trash\TrashItemDeleteResultList

}

Implements eZ\Publish\SPI\Persistence\Content\Location\Trash\Handler.

Definition at line 202 of file Core/Persistence/Legacy/Content/Location/Trash/Handler.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler\findTrashItems().

## ◆ findTrashItems()

eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::findTrashItems | ( | Criterion | $criterion = `null`,
|  |  | $offset = `0`,
|  |  | $limit = `null`,
|  | array | $sort = `null`
| ) |  |

{Returns all trashed locations satisfying the $criterion (if provided), sorted with $sort (if any).If no criterion is provided (null), no filter is applied.TrashResult->totalCount will ignore limit and offset and representing the total amount of trashed items matching the criterion.

Parameters

  \eZ\Publish\API\Repository\Values\Content\Query\Criterion | $criterion |
  int | $offset | Offset to start listing from, 0 by default
  int | $limit | Limit for the listing. Null by default (no limit)
  \eZ\Publish\API\Repository\Values\Content\Query\SortClause[] | $sort |

Returns
  \eZ\Publish\SPI\Persistence\Content\Location\Trashed[]|\eZ\Publish\SPI\Persistence\Content\Location\Trash\TrashResult

}.

Implements eZ\Publish\SPI\Persistence\Content\Location\Trash\Handler.

Definition at line 175 of file Core/Persistence/Legacy/Content/Location/Trash/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler\emptyTrash().

## ◆ loadTrashItem()

eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::loadTrashItem | ( |  | $id | ) |

Loads the data for the trashed location identified by $id.

$id is the same as original location (which has been previously trashed).

Parameters

  int | $id |

Exceptions

Implements eZ\Publish\SPI\Persistence\Content\Location\Trash\Handler.

Definition at line 87 of file Core/Persistence/Legacy/Content/Location/Trash/Handler.php.

References eZ\Publish\SPI\Persistence\Content\Location\$id.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler\deleteTrashItem(), and eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler\trashSubtree().

## ◆ recover()

eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::recover | ( |  | $trashedId,
|  |  | $newParentId
| ) |  |

Returns a trashed location to normal state.

Recreates the originally trashed location in the new position. If this is not possible (because the old location does not exist any more), a ParentNotFound exception is thrown.

Returns newly restored location Id.

Parameters

  mixed | $trashedId |
  mixed | $newParentId |

Returns
  int Newly restored location id

Exceptions

Implements eZ\Publish\SPI\Persistence\Content\Location\Trash\Handler.

Definition at line 167 of file Core/Persistence/Legacy/Content/Location/Trash/Handler.php.

## ◆ trashSubtree()

eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::trashSubtree | ( |  | $locationId | ) |

Sends a subtree starting to $locationId to the trash and returns a Trashed object corresponding to $locationId.

Moves all locations in the subtree to the Trash. The associated content objects are left untouched.

Parameters

  mixed | $locationId |

Todo:
  Handle field types actions

Returns
  \eZ\Publish\SPI\Persistence\Content\Location\Trashed|null null if location was deleted, otherwise Trashed object

Implements eZ\Publish\SPI\Persistence\Content\Location\Trash\Handler.

Definition at line 107 of file Core/Persistence/Legacy/Content/Location/Trash/Handler.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler\loadTrashItem().

## Member Data Documentation

## ◆ $contentHandler

eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::$contentHandler
| protected

Definition at line 53 of file Core/Persistence/Legacy/Content/Location/Trash/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler\__construct().

## ◆ $locationGateway

eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::$locationGateway
| protected

Definition at line 39 of file Core/Persistence/Legacy/Content/Location/Trash/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler\__construct().

## ◆ $locationHandler

eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::$locationHandler
| protected

Definition at line 32 of file Core/Persistence/Legacy/Content/Location/Trash/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler\__construct().

## ◆ $locationMapper

eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::$locationMapper
| protected

Definition at line 46 of file Core/Persistence/Legacy/Content/Location/Trash/Handler.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler\__construct().

## ◆ EMPTY_TRASH_BULK_SIZE

const eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::EMPTY_TRASH_BULK_SIZE = 100
| private

Definition at line 25 of file Core/Persistence/Legacy/Content/Location/Trash/Handler.php.

The documentation for this class was generated from the following file:

- Core/Persistence/Legacy/Content/Location/Trash/Handler.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.