id = $row['id']; $model->tipologia = $this->getMapper(Tipologia::class)->fetchById($row['tipologia']); $model->cantidad = $row['cantidad']; $model->elemento = $this->getMapper(TipoElemento::class)->fetchById($row['elemento']); return $model; } public function save(Model $model): bool { // TODO: Implement save() method. } public function fetchByPTU(int $ptu_id): array { $qb = $this->connection->createQueryBuilder() ->select('tt.*') ->from($this->table, 'tt') ->innerJoin('tt', 'tipo_elemento', 'te', 'te.id = tt.elemento') ->where('tt.tipo = ?') ->orderBy('te.orden'); return array_map([$this, 'load'], $this->connection->executeQuery($qb, [$ptu_id])->fetchAllAssociative()); } }