[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 4 namespace Fig\Link; 5 6 use Psr\Link\LinkProviderInterface; 7 use Psr\Link\LinkInterface; 8 9 /** 10 * Class LinkProviderTrait 11 * 12 * @implements LinkProviderInterface 13 */ 14 trait LinkProviderTrait 15 { 16 /** 17 * An array of the links in this provider. 18 * 19 * The keys of the array MUST be the spl_object_hash() of the object being stored. 20 * That helps to ensure uniqueness. 21 * 22 * @var LinkInterface[] 23 */ 24 private $links = []; 25 26 /** 27 * {@inheritdoc} 28 */ 29 public function getLinks() 30 { 31 return $this->links; 32 } 33 34 /** 35 * {@inheritdoc} 36 */ 37 public function getLinksByRel($rel) 38 { 39 $filter = function (LinkInterface $link) use ($rel) { 40 return in_array($rel, $link->getRels()); 41 }; 42 return array_filter($this->links, $filter); 43 } 44 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |