Announcement

Collapse
No announcement yet.

Extending Orm/RDB

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Extending Orm/RDB

    what am trying to extend is

    PHP Code:
      \Espo\Core\ORM\Repositories\RDB 
    as follow:

    PHP Code:
    <?php  namespace Espo\Custom\ORM\Repositories;  
    class 
    RDB extends \Espo\Core\ORM\Repositories\RDB {    
    public function 
    handleSelectParams(&$params)     {         parent::handleSelectParams($params);         $this->handleMeasurementParams($params);     }      protected function handleMeasurementParams(&$params)     {         die(var_dump("here"));         $entityType $this->entityType;          $metadata $this->getMetadata();          if (!$metadata) {             return;         }          $defs $metadata->get('entityDefs.' $entityType);          foreach ($defs['fields'] as $field => $d) {             if (isset($d['type']) && $d['type'] == 'measurement') {                 if (!empty($d['notStorable'])) {                     continue;                 }                 if (empty($params['customJoin'])) {                     $params['customJoin'] = '';                 }                 $alias Util::toUnderScore($field) . "_measurement_alias";                 $params['customJoin'] .= "                     LEFT JOIN measurement AS `{$alias}` ON {$alias}.id = ".Util::toUnderScore($entityType).".".Util::toUnderScore($field)."_measurement                 ";             }         }      } }
    but it's not reading my custom class , is there away to inject/hook it?

  • #2
    Only this will work

    \Espo\Custom\Repositories\CustomEntityName

    Comment


    • #3
      Originally posted by yurikuzn View Post
      Only this will work

      \Espo\Custom\Repositories\CustomEntityName
      any plans for allowing it to be extended , because it's really needed , I can do it though , but it might get conflicted with your updates!

      Comment


      • #4
        Not possible technically.

        Comment


        • #5
          Originally posted by yurikuzn View Post
          Not possible technically.
          it is possible by Injection/Hooks

          Comment

          Working...
          X