|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?php
-
- namespace Lc\SovBundle\Component;
-
- class MetaComponent
- {
-
- public function getMetaTitle($entity)
- {
- if($entity) {
- if(method_exists($entity, 'getMetaTitle')) {
- return $entity->getMetaTitle() ;
- }
- elseif(method_exists($entity, 'getTitle')) {
- return $entity->getTitle() ;
- }
- }
-
- return '' ;
- }
-
- public function getMetaDescription($entity)
- {
- if($entity) {
- if(method_exists($entity, 'getMetaDescription')) {
- return $entity->getMetaDescription() ;
- }
- elseif(method_exists($entity, 'getDescription')) {
- return $entity->getDescription() ;
- }
- }
-
- return '' ;
- }
-
- public function getOpenGraphTitle($entity)
- {
- if($entity) {
- if(method_exists($entity, 'getOpenGraphTitle')) {
- return $entity->getOpenGraphTitle() ;
- }
- elseif(method_exists($entity, 'getTitle')) {
- return $entity->getTitle() ;
- }
- }
-
- return '' ;
- }
-
- public function getOpenGraphDescription($entity)
- {
- if($entity) {
- if(method_exists($entity, 'getOpenGraphDescription')) {
- return $entity->getOpenGraphDescription() ;
- }
- elseif(method_exists($entity, 'getDescription')) {
- return $entity->getDescription() ;
- }
- }
-
- return '' ;
- }
-
- public function getOpenGraphImage($entity)
- {
- if($entity) {
- if(method_exists($entity, 'getOpenGraphImage')) {
- return $entity->getOpenGraphImage() ;
- }
- elseif(method_exists($entity, 'getImage')) {
- return $entity->getImage() ;
- }
- }
-
- return '' ;
- }
-
- }
|