/** * Encontra o tipo de setor a partir da descrição * * @param string $TypeName * @return int */ public static function SetTypeByName($TypeName) { $Read = new WsSetorType(); $Read->setType_content($TypeName); $query = $Read->Execute()->Query("#type_content# AND type_status = 1"); if ($Read->Execute()->getResult()) { return (int) $query[0]->type_id; } else { WSErro("O tipo de setor <b>{$TypeName}</b> não foi encontrado!", WS_ERROR); return null; } }