what am trying to extend is
as follow:
but it's not reading my custom class , is there away to inject/hook it?
PHP Code:
\Espo\Core\ORM\Repositories\RDB
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 "; } } } }
Comment