annotate vendor/symfony-cmf/routing/ContentRepositoryInterface.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 /*
Chris@0 4 * This file is part of the Symfony CMF package.
Chris@0 5 *
Chris@0 6 * (c) 2011-2015 Symfony CMF
Chris@0 7 *
Chris@0 8 * For the full copyright and license information, please view the LICENSE
Chris@0 9 * file that was distributed with this source code.
Chris@0 10 */
Chris@0 11
Chris@0 12 namespace Symfony\Cmf\Component\Routing;
Chris@0 13
Chris@0 14 /**
Chris@0 15 * Interface used by the DynamicRouter to retrieve content by it's id when
Chris@0 16 * generating routes from content-id.
Chris@0 17 *
Chris@0 18 * This can be easily implemented using i.e. the Doctrine PHPCR-ODM
Chris@0 19 * DocumentManager.
Chris@0 20 *
Chris@0 21 * @author Uwe Jäger
Chris@0 22 */
Chris@0 23 interface ContentRepositoryInterface
Chris@0 24 {
Chris@0 25 /**
Chris@0 26 * Return a content object by it's id or null if there is none.
Chris@0 27 *
Chris@0 28 * If the returned content implements RouteReferrersReadInterface, it will
Chris@0 29 * be used to get the route from it to generate an URL.
Chris@0 30 *
Chris@0 31 * @param string $id id of the content object
Chris@0 32 *
Chris@0 33 * @return object A content that matches this id.
Chris@0 34 */
Chris@0 35 public function findById($id);
Chris@0 36
Chris@0 37 /**
Chris@0 38 * Return the content identifier for the provided content object for
Chris@0 39 * debugging purposes.
Chris@0 40 *
Chris@0 41 * @param object $content A content instance
Chris@0 42 *
Chris@0 43 * @return string|null $id id of the content object or null if unable to determine an id
Chris@0 44 */
Chris@0 45 public function getContentId($content);
Chris@0 46 }