/** * Selecionar um registro através da chave primária (PK - Primary Key) * * @param mixed $v Valor a ser pesquisado na PK * @param string $a Alias da tabela principal configurado na consulta * * @return bool * @throws \DL3Exception */ public function selecionarPK($v, $a = null) { if (parent::selecionarPK($v, $a)) { $this->dir_upload = sprintf(static::DIR_UPLOAD, $this->id); return true; } // Fim if return false; }
/** * Selecionar um registro através da chave primária (PK - Primary Key) * * @param string $v Valor a ser pesquisado na PK * @param string $a Alias da tabela principal configurado na consulta * * @return bool * @throws \DL3Exception */ public function selecionarPK($v, $a = 'M') { return parent::selecionarPK($v, $a); }
/** * Selecionar um registro através da chave primária (PK - Primary Key) * * @param string $v Valor a ser pesquisado na PK * @param string $a Alias da tabela principal configurado na consulta * * @return bool * @throws \DL3Exception */ public function selecionarPK($v, $a = null) { if (parent::selecionarPK($v, $a)) { # Selecionar os métodos dessa classe $sql = \DL3::$conex->prepare("SELECT metodo_func_descr FROM dl_painel_funcs_metodos WHERE metodo_func = :id"); $sql->execute([':id' => $this->id]); if ($sql !== false) { $this->metodos = $sql->fetchAll(\PDO::FETCH_COLUMN, 0); } // Fim if # Selecionar os grupos dessa classe $sql = \DL3::$conex->prepare("SELECT grupo_usuario_id FROM dl_painel_grupos_funcs WHERE func_modulo_id = :id"); $sql->execute([':id' => $this->id]); if ($sql !== false) { $this->grupos = $sql->fetchAll(\PDO::FETCH_COLUMN, 0); } // Fim if return true; } // Fim if return false; }
/** * Selecionar um registro através da chave primária (PK - Primary Key) * * @param string $v Valor a ser pesquisado na PK * @param string $a Alias da tabela principal configurado na consulta * * @return bool * @throws \DL3Exception */ public function selecionarPK($v, $a = null) { if (parent::selecionarPK($v, $a)) { $sql = \DL3::$conex->prepare("SELECT func_modulo_id FROM dl_painel_grupos_funcs WHERE {$this->bd_prefixo}id = :id"); $sql->execute([':id' => $this->id]); if ($sql === false) { return true; } // Fim if $this->funcs = $sql->fetchAll(\PDO::FETCH_COLUMN, 0); return true; } // Fim if return false; }