Manual:ApiMain.php

This page is a translated version of the page Manual:ApiMain.php and the translation is 44% complete.
Outdated translations are marked like this.

ApiMain ye la clase principal de la API, que s'usa tanto pal procesamientu esternu como internu. Al executala, creará l'oxetu formateador solicitáu, instanciará y executará un oxetu asociáu cola aición necesaria, y usa el formateador pa imprimir los resultaos. En casu d'una esceición, imprimiráse un mensaxe d'error usando'l mesmu formateador. Pa usar la API dende otra aplicación, execútala usando l'oxetu $faux; nesti casu nun se xestionarán les esceiciones internes, sinón que se pasarán al llamante. Tres una execución correuta, usa getResult() pa los datos resultantes. When executed, it will create the requested formatter object, instantiate and execute an object associated with the needed action, and use formatter to print results. In case of an exception, an error message will be printed using the same formatter. To call the API programmatically for testing, run it using the FauxRequest object, in which case any internal exceptions will not be handled but passed up to the caller. After successful execution, use getResult() for the resulting data.

Funciones

getResult()

getResult() algama l'oxetu ApiResult asociáu cola solicitú actual.

Ver tamién