PageRenderTime 71ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/ide/0.4.0/inspector.php

https://github.com/AntonShevchuk/phalcon-devtools
PHP | 8823 lines | 2034 code | 1129 blank | 5660 comment | 1 complexity | cf86fdea2a41884e2967a508110168ae MD5 | raw file
Possible License(s): BSD-3-Clause, MIT
  1. <?php if(!extension_loaded("phalcon")){
  2. /**
  3. * Phalcon_Acl
  4. *
  5. * This component allows to manage ACL lists. An access control list (ACL) is a list
  6. * of permissions attached to an object. An ACL specifies which users or system processes
  7. * are granted access to objects, as well as what operations are allowed on given objects.
  8. *
  9. *<code>
  10. *$acl = new Phalcon_Acl('Memory');
  11. *
  12. * //Default action is deny access
  13. *$acl->setDefaultAction(Phalcon_Acl::DENY);
  14. *
  15. * //Create some roles
  16. *$roleAdmins = new Phalcon_Acl_Role('Administrators', 'Super-User role');
  17. *$roleGuests = new Phalcon_Acl_Role('Guests');
  18. *
  19. * //Add "Guests" role to acl
  20. *acl->addRole($roleGuests);
  21. *
  22. * //Add "Designers" role to acl
  23. *$acl->addRole('Designers'));
  24. *
  25. * //Define the "Customers" resource
  26. *$customersResource = new Phalcon_Acl_Resource('Customers', 'Customers management');
  27. *
  28. * //Add "customers" resource with a couple of operations
  29. *$acl->addResource($customersResource, 'search');
  30. *$acl->addResource($customersResource, array('create', 'update'));
  31. *
  32. * //Set access level for roles into resources
  33. *$acl->allow('Guests', 'Customers', 'search');
  34. *$acl->allow('Guests', 'Customers', 'create');
  35. *$acl->deny('Guests', 'Customers', 'update');
  36. *
  37. * //Check whether role has access to the operations
  38. *$acl->isAllowed('Guests', 'Customers', 'edit') //Returns 0
  39. *$acl->isAllowed('Guests', 'Customers', 'search'); //Returns 1
  40. *$acl->isAllowed('Guests', 'Customers', 'create'); //Returns 1
  41. *</code>
  42. */
  43. class Phalcon_Acl
  44. {
  45. const ALLOW = 1;
  46. const DENY = 0;
  47. /**
  48. * Phalcon_Acl Constructor
  49. *
  50. * @param string $adapterName
  51. * @param array $options
  52. */
  53. public function __construct($adapterName='Memory', $options=array ()){
  54. }
  55. /**
  56. * Pass any call to the internal adapter object
  57. *
  58. * @param string $method
  59. * @param array $arguments
  60. * @return mixed
  61. */
  62. public function __call($method, $arguments=array ()){
  63. }
  64. }
  65. /**
  66. * Phalcon_Cache
  67. *
  68. * Phalcon_Cache can be used to cache output fragments to improve performance
  69. *
  70. *<code>
  71. * //Cache the file for 2 days
  72. *$frontendOptions = array(
  73. * 'lifetime' => 172800
  74. *);
  75. *
  76. * //Set the cache directory
  77. *$backendOptions = array(
  78. * 'cacheDir' => '../app/cache/'
  79. *);
  80. *
  81. *$cache = Phalcon_Cache::factory('Output', 'File', $frontendOptions, $backendOptions);
  82. *
  83. *$content = $cache->start('my-cache');
  84. *if($content===null){
  85. * echo time();
  86. * $cache->save();
  87. *} else {
  88. * echo $content;
  89. *}
  90. *</code>
  91. */
  92. class Phalcon_Cache
  93. {
  94. /**
  95. * Factories different caches backends from its adapters
  96. *
  97. * @param string $frontendAdapter
  98. * @param string $backendAdapter
  99. * @param array $frontendOptions
  100. * @param array $backendOptions
  101. * @return Phalcon_Cache_Backend_File
  102. * @static
  103. */
  104. public static function factory($frontendAdapter, $backendAdapter, $frontendOptions=array (), $backendOptions=array ()){
  105. }
  106. }
  107. /**
  108. * Phalcon_Config
  109. *
  110. * Phalcon_Config is designed to simplify the access to, and the use of, configuration data within applications.
  111. * It provides a nested object property based user interface for accessing this configuration data within
  112. * application code.
  113. *
  114. * <code>$config = new Phalcon_Config(array(
  115. * "database" => array(
  116. * "adapter" => "Mysql",
  117. * "host" => "localhost",
  118. * "username" => "scott",
  119. * "password" => "cheetah",
  120. * "name" => "test_db"
  121. * ),
  122. * "phalcon" => array(
  123. * "controllersDir" => "../app/controllers/",
  124. * "modelsDir" => "../app/models/",
  125. * "viewsDir" => "../app/views/"
  126. * )
  127. * ));</code>
  128. *
  129. */
  130. class Phalcon_Config
  131. {
  132. /**
  133. * Phalcon_Config constructor
  134. *
  135. * @param array $arrayConfig
  136. * @return Phalcon_Config
  137. */
  138. public function __construct($arrayConfig=array ()){
  139. }
  140. }
  141. /**
  142. * Phalcon_Controller
  143. *
  144. * Every application controller should extend this class that encapsulates all the controller functionality
  145. *
  146. * The controllers provide the “flow” between models and views. Controllers are responsible
  147. * for processing the incoming requests from the web browser, interrogating the models for data,
  148. * and passing that data on to the views for presentation.
  149. *
  150. *<code>
  151. *
  152. *
  153. * class PeopleController extends Phalcon_Controller {
  154. *
  155. * //This action will be executed by default
  156. * public function indexAction(){
  157. *
  158. * }
  159. *
  160. * public function findAction(){
  161. *
  162. * }
  163. *
  164. * public function saveAction(){
  165. * //Forwards flow to the index action
  166. * return $this->_forward('people/index');
  167. * }
  168. *
  169. * //This action will be executed when a non existent action is requested
  170. * public function notFoundAction(){
  171. *
  172. * }
  173. *
  174. * }
  175. *
  176. *</code>
  177. */
  178. class Phalcon_Controller
  179. {
  180. /**
  181. * @var Phalcon_Dispatcher
  182. */
  183. public $dispatcher;
  184. /**
  185. * @var Phalcon_Request
  186. */
  187. public $request;
  188. /**
  189. * @var Phalcon_Response
  190. */
  191. public $response;
  192. /**
  193. * @var Phalcon_View
  194. */
  195. public $view;
  196. /**
  197. * @var Phalcon_Model_Manager
  198. */
  199. public $model;
  200. /**
  201. * Constructor for Phalcon_Controller
  202. *
  203. * @param Phalcon_Dispatcher $dispatcher
  204. * @param Phalcon_Request $request
  205. * @param Phalcon_Response $response
  206. * @param Phalcon_View $view
  207. * @param Phalcon_Model_Manager $model
  208. */
  209. final public function __construct($dispatcher, $request, $response, $view=NULL, $model=NULL){
  210. }
  211. /**
  212. * Forwards execution flow to another controller/action.
  213. *
  214. * @param string $uri
  215. */
  216. protected function _forward($uri){
  217. }
  218. /**
  219. * Returns a param from the dispatching params
  220. *
  221. * @param mixed $index
  222. */
  223. protected function _getParam($index){
  224. }
  225. /**
  226. * Magic method __get
  227. *
  228. * @param string $propertyName
  229. */
  230. public function __get($propertyName){
  231. }
  232. }
  233. /**
  234. * Phalcon_Db
  235. *
  236. * Phalcon_Db and its related classes provide a simple SQL database interface for Phalcon Framework.
  237. * The Phalcon_Db is the basic class you use to connect your PHP application to a RDBMS.
  238. * There is a different adapter class for each brand of RDBMS.
  239. *
  240. * This component is intended to low level database operations. If you want to interact with databases using
  241. * high level abstraction use Phalcon_Model.
  242. *
  243. * Phalcon_Db is an abstract class. You only can use it with a database adapter like Phalcon_Db_Mysql
  244. *
  245. * <code>
  246. *
  247. *$config = new stdClass();
  248. *$config->host = 'localhost';
  249. *$config->username = 'machine';
  250. *$config->password = 'sigma';
  251. *$config->name = 'swarm';
  252. *
  253. *try {
  254. *
  255. * $connection = Phalcon_Db::factory('Mysql', $config);
  256. *
  257. * $connection->setFetchMode(Phalcon_Db::DB_NUM);
  258. * $result = $connection->query("SELECT * FROM robots LIMIT 5");
  259. * while($robot = $connection->fetchArray($result)){
  260. * print_r($robot);
  261. * }
  262. *
  263. *}
  264. *catch(Phalcon_Db_Exception $e){
  265. * echo $e->getMessage(), PHP_EOL;
  266. *}
  267. *
  268. * </code>
  269. */
  270. abstract class Phalcon_Db
  271. {
  272. const DB_ASSOC = 1;
  273. const DB_BOTH = 2;
  274. const DB_NUM = 3;
  275. /**
  276. * Phalcon_Db constructor, this method should not be called directly. Use Phalcon_Db::factory instead
  277. *
  278. * @param stdClass $descriptor
  279. */
  280. protected function __construct($descriptor){
  281. }
  282. /**
  283. * Sets a logger class to log all SQL operations sent to database server
  284. *
  285. * @param Phalcon_Logger $logger
  286. */
  287. public function setLogger($logger){
  288. }
  289. /**
  290. * Returns the active logger
  291. *
  292. * @return Phalcon_Logger
  293. */
  294. public function getLogger(){
  295. }
  296. /**
  297. * Sends arbitrary text to a related logger in the instance
  298. *
  299. * @param string $sqlStatement
  300. * @param int $type
  301. */
  302. protected function log($sqlStatement, $type){
  303. }
  304. /**
  305. * Sets a database profiler to the connection
  306. *
  307. * @param Phalcon_Db_Profiler $profiler
  308. */
  309. public function setProfiler($profiler){
  310. }
  311. /**
  312. * Returns the first row in a SQL query result
  313. *
  314. * <code>
  315. * //Getting first robot
  316. * $robot = $connection->fecthOne("SELECT * FROM robots");
  317. * print_r($robot);
  318. * </code>
  319. *
  320. * @param string $sqlQuery
  321. * @return array
  322. */
  323. public function fetchOne($sqlQuery){
  324. }
  325. /**
  326. * Dumps the complete result of a query into an array
  327. *
  328. * <code>
  329. * //Getting all robots
  330. * $robots = $connection->fetchAll("SELECT * FROM robots");
  331. * foreach($robots as $robot){
  332. * print_r($robot);
  333. * }
  334. * </code>
  335. *
  336. * @param string $sqlQuery
  337. * @return array
  338. */
  339. public function fetchAll($sqlQuery){
  340. }
  341. /**
  342. * Inserts data into a table using custom RBDM SQL syntax
  343. *
  344. * <code>
  345. * //Inserting a new robot
  346. * $success = $connection->insert(
  347. * "robots",
  348. * array("Astro Boy", 1952),
  349. * array("name", "year")
  350. * );
  351. *
  352. * //Next SQL sentence is sent to the database system
  353. * INSERT INTO `robots` (`name`, `year`) VALUES ("Astro boy", 1952);
  354. * </code>
  355. *
  356. * @param string $tables
  357. * @param array $values
  358. * @param array $fields
  359. * @param boolean $automaticQuotes
  360. * @return boolean
  361. */
  362. public function insert($table, $values, $fields=NULL, $automaticQuotes=false){
  363. }
  364. /**
  365. * Updates data on a table using custom RBDM SQL syntax
  366. *
  367. * <code>
  368. * //Updating existing robot
  369. * $success = $connection->update(
  370. * "robots",
  371. * array("name")
  372. * array("New Astro Boy"),
  373. * "id = 101"
  374. * );
  375. *
  376. * //Next SQL sentence is sent to the database system
  377. * UPDATE `robots` SET `name` = "Astro boy" WHERE id = 101
  378. * </code>
  379. *
  380. * @param string $tables
  381. * @param array $fields
  382. * @param array $values
  383. * @param string $whereCondition
  384. * @param boolean $automaticQuotes
  385. * @return boolean
  386. */
  387. public function update($table, $fields, $values, $whereCondition=NULL, $automaticQuotes=false){
  388. }
  389. /**
  390. * Deletes data from a table using custom RBDM SQL syntax
  391. *
  392. * <code>
  393. * //Deleting existing robot
  394. * $success = $connection->delete(
  395. * "robots",
  396. * "id = 101"
  397. * );
  398. *
  399. * //Next SQL sentence is generated
  400. * DELETE FROM `robots` WHERE id = 101
  401. * </code>
  402. *
  403. * @param string $tables
  404. * @param string $whereCondition
  405. * @return boolean
  406. */
  407. public function delete($table, $whereCondition=''){
  408. }
  409. /**
  410. * Starts a transaction in the connection
  411. *
  412. * @return boolean
  413. */
  414. public function begin(){
  415. }
  416. /**
  417. * Rollbacks the active transaction in the connection
  418. *
  419. * @return boolean
  420. */
  421. public function rollback(){
  422. }
  423. /**
  424. * Commits the active transaction in the connection
  425. *
  426. * @return boolean
  427. */
  428. public function commit(){
  429. }
  430. /**
  431. * Manually sets a "under transaction" state for the connection
  432. *
  433. * @param boolean $underTransaction
  434. */
  435. protected function setUnderTransaction($underTransaction){
  436. }
  437. /**
  438. * Checks whether connection is under database transaction
  439. *
  440. * @return boolean
  441. */
  442. public function isUnderTransaction(){
  443. }
  444. /**
  445. * Checks whether connection have auto commit
  446. *
  447. * @return boolean
  448. */
  449. public function getHaveAutoCommit(){
  450. }
  451. /**
  452. * Returns database name in the internal connection
  453. *
  454. * @return string
  455. */
  456. public function getDatabaseName(){
  457. }
  458. /**
  459. * Returns active schema name in the internal connection
  460. *
  461. * @return string
  462. */
  463. public function getDefaultSchema(){
  464. }
  465. /**
  466. * Returns the username which has connected to the database
  467. *
  468. * @return string
  469. */
  470. public function getUsername(){
  471. }
  472. /**
  473. * Returns the username which has connected to the database
  474. *
  475. * @return string
  476. */
  477. public function getHostName(){
  478. }
  479. /**
  480. * Gets an active connection unique identifier
  481. *
  482. * @return string
  483. */
  484. public function getConnectionId($asString=false){
  485. }
  486. /**
  487. * This method is executed before every SQL statement sent to the database system
  488. *
  489. * @param string $sqlStatement
  490. */
  491. protected function _beforeQuery($sqlStatement){
  492. }
  493. /**
  494. * This method is executed after every SQL statement sent to the database system
  495. *
  496. * @param string $sqlStatement
  497. */
  498. protected function _afterQuery($sqlStatement){
  499. }
  500. /**
  501. * Instantiates Phalcon_Db adapter using given parameters
  502. *
  503. * @param string $adapterName
  504. * @param stdClass $options
  505. * @return Phalcon_Db
  506. */
  507. public static function factory($adapterName, $options){
  508. }
  509. }
  510. /**
  511. * Phalcon_Dispatcher
  512. *
  513. * Dispatching is the process of taking the request object, extracting the module name,
  514. * controller name, action name, and optional parameters contained in it, and then
  515. * instantiating a controller and calling an action of that controller.
  516. *
  517. * <code>
  518. *
  519. *$dispatcher = new Phalcon_Dispatcher();
  520. *
  521. *$request = Phalcon_Request::getInstance();
  522. *$response = Phalcon_Response::getInstance();
  523. *
  524. *$dispatcher->setBasePath('./');
  525. *$dispatcher->setControllersDir('tests/controllers/');
  526. *
  527. *$dispatcher->setControllerName('posts');
  528. *$dispatcher->setActionName('index');
  529. *$dispatcher->setParams(array());
  530. *$controller = $dispatcher->dispatch($request, $response);
  531. *
  532. *</code>
  533. */
  534. class Phalcon_Dispatcher
  535. {
  536. /**
  537. * Sets default controllers directory. Depending of your platform, always add a trailing slash or backslash
  538. *
  539. * @param string $controllersDir
  540. */
  541. public function setControllersDir($controllersDir){
  542. }
  543. /**
  544. * Gets active controllers directory
  545. *
  546. * @return string
  547. */
  548. public function getControllersDir(){
  549. }
  550. /**
  551. * Sets base path for controllers dir. Depending of your platform, always add a trailing slash or backslash
  552. *
  553. * @param string $basePath
  554. */
  555. public function setBasePath($basePath){
  556. }
  557. /**
  558. * Gets base path for controllers dir
  559. *
  560. * @return string
  561. */
  562. public function getBasePath(){
  563. }
  564. /**
  565. * Sets the controller name to be dispatched
  566. *
  567. * @param string $controllerName
  568. */
  569. public function setControllerName($controllerName){
  570. }
  571. /**
  572. * Gets last dispatched controller name
  573. *
  574. * @return string
  575. */
  576. public function getControllerName(){
  577. }
  578. /**
  579. * Sets the action name to be dispatched
  580. *
  581. * @param string $actionName
  582. */
  583. public function setActionName($actionName){
  584. }
  585. /**
  586. * Gets last dispatched action name
  587. *
  588. * @return string
  589. */
  590. public function getActionName(){
  591. }
  592. /**
  593. * Sets action params to be dispatched
  594. *
  595. * @param array $params
  596. */
  597. public function setParams($params){
  598. }
  599. /**
  600. * Gets action params
  601. *
  602. * @return array
  603. */
  604. public function getParams(){
  605. }
  606. /**
  607. * Gets a param by its name or numeric index
  608. *
  609. * @param mixed $param
  610. * @return mixed
  611. */
  612. public function getParam($index){
  613. }
  614. /**
  615. * Dispatches a controller action taking into account the routing parameters
  616. *
  617. * @param Phalcon_Request $request
  618. * @param Phalcon_Response $response
  619. * @param Phalcon_View $view
  620. * @param Phalcon_Model_Manager $model
  621. * @return Phalcon_Controller
  622. */
  623. public function dispatch($request, $response, $view=NULL, $model=NULL){
  624. }
  625. /**
  626. * Throws an internal exception
  627. *
  628. * @param Phalcon_Response $response
  629. * @param string $message
  630. */
  631. protected function _throwDispatchException($response, $message){
  632. }
  633. /**
  634. * Routes to a controller/action using a string or array uri
  635. *
  636. * @param string $uri
  637. */
  638. public function forward($uri){
  639. }
  640. /**
  641. * Returns all instantiated controllers whitin the dispatcher
  642. *
  643. * @return array
  644. */
  645. public function getControllers(){
  646. }
  647. /**
  648. * Returns last dispatched controller
  649. *
  650. * @return Phalcon_Controller
  651. */
  652. public function getLastController(){
  653. }
  654. /**
  655. * Returns value returned by last dispacthed action
  656. *
  657. * @return mixed
  658. */
  659. public function getReturnedValue(){
  660. }
  661. }
  662. /**
  663. * Phalcon_Exception
  664. *
  665. * All framework exceptions should use this exception
  666. */
  667. class Phalcon_Exception extends Exception
  668. {
  669. final private function __clone(){
  670. }
  671. public function __construct($message, $code, $previous){
  672. }
  673. final public function getMessage(){
  674. }
  675. final public function getCode(){
  676. }
  677. final public function getFile(){
  678. }
  679. final public function getLine(){
  680. }
  681. final public function getTrace(){
  682. }
  683. final public function getPrevious(){
  684. }
  685. final public function getTraceAsString(){
  686. }
  687. public function __toString(){
  688. }
  689. }
  690. /**
  691. * Phalcon_Filter
  692. *
  693. * The Phalcon_Filter component provides a set of commonly needed data filters. It provides
  694. * object oriented wrappers to the php filter extension
  695. *
  696. *<code>
  697. *$filter = new Phalcon_Filter();
  698. *$filter->sanitize("some(one)@exa\\mple.com", "email"); // returns "someone@example.com"
  699. *$filter->sanitize("hello<<", "string"); // returns "hello"
  700. *$filter->sanitize("!100a019", "int"); // returns "!100a019"
  701. *$filter->sanitize("!100a019.01a", "float"); // returns "100019.01"
  702. *</code>
  703. *
  704. */
  705. class Phalcon_Filter
  706. {
  707. /**
  708. * Sanizites a value with a specified single or set of filters
  709. *
  710. * @param mixed $value
  711. * @param mixed $filters
  712. * @param boolean $silent
  713. * @return mixed
  714. */
  715. public function sanitize($value, $filters, $silent=false){
  716. }
  717. /**
  718. * Filters a value with a specified single or set of filters
  719. *
  720. * @param mixed $value
  721. * @param array $filters
  722. * @param boolean $silent
  723. * @return mixed
  724. */
  725. public function filter($value, $filters, $silent=false){
  726. }
  727. /**
  728. * Sanitize and Filter a value with a specified single or set of filters
  729. *
  730. * @param mixed $value
  731. * @param array $filters
  732. * @return mixed
  733. */
  734. public function sanitizeAndFilter($value, $filters){
  735. }
  736. /**
  737. * Internal sanizite wrapper to filter_var
  738. *
  739. * @param mixed $value
  740. * @param mixed $filters
  741. * @param boolean $silent
  742. * @return mixed
  743. */
  744. protected function _sanitize($value, $filter, $silent=false){
  745. }
  746. /**
  747. * Internal filter function
  748. *
  749. * @param mixed $value
  750. * @param array $filters
  751. * @param boolean $silent
  752. * @return mixed
  753. */
  754. protected function _filter($value, $filter, $silent=false){
  755. }
  756. }
  757. /**
  758. * Phalcon_Flash
  759. *
  760. * Shows HTML notifications related to different circumstances. Classes can be stylized using CSS
  761. */
  762. class Phalcon_Flash
  763. {
  764. private static function _showMessage($message, $classes){
  765. }
  766. /**
  767. * Shows a HTML error message
  768. *
  769. * <code>Phalcon_Flash::error('This is an error'); </code>
  770. *
  771. * @param string $message
  772. * @param string $classes
  773. * @return string
  774. */
  775. public static function error($message, $classes='errorMessage'){
  776. }
  777. /**
  778. * Shows a HTML notice/information message
  779. *
  780. * <code>Phalcon_Flash::notice('This is an information'); </code>
  781. *
  782. * @param string $message
  783. * @param string $classes
  784. * @return string
  785. */
  786. public static function notice($message, $classes='noticeMessage'){
  787. }
  788. /**
  789. * Shows a HTML success message
  790. *
  791. * <code>Phalcon_Flash::success('The process was finished successfully'); </code>
  792. *
  793. * @param string $message
  794. * @param string $classes
  795. * @return string
  796. */
  797. public static function success($message, $classes='successMessage'){
  798. }
  799. /**
  800. * Shows a HTML warning message
  801. *
  802. * <code>Phalcon_Flash::warning('Hey, this is important'); </code>
  803. * <code>Phalcon_Flash::warning('Hey, this is important', 'alert alert-warning'); </code>
  804. *
  805. * @param string $message
  806. * @param string $classes
  807. * @return string
  808. */
  809. public static function warning($message, $classes='warningMessage'){
  810. }
  811. }
  812. /**
  813. * Phalcon_Loader
  814. *
  815. * This component helps to load your project classes automatically based on some conventions
  816. *
  817. *<code>
  818. * //Creates the autoloader
  819. *$loader = new Phalcon_Loader();
  820. *
  821. * //Register some namespaces
  822. *$loader->registerNamespaces(array(
  823. * 'Example\\Base' => 'vendor/example/base/',
  824. * 'Example\\Adapter' => 'vendor/example/adapter/'
  825. * 'Example' => 'vendor/example/'
  826. *));
  827. *
  828. * //register autoloader
  829. * $loader->register();
  830. *
  831. * //Requiring class will automatically include file vendor/example/adapter/Some.php
  832. * $adapter = Example\Adapter\Some();
  833. *</code>
  834. */
  835. class Phalcon_Loader
  836. {
  837. /**
  838. * Register namespaces and its related directories
  839. *
  840. * @param array $directories
  841. */
  842. public function registerNamespaces($namespaces){
  843. }
  844. /**
  845. * Register directories on which not found classes could be found
  846. *
  847. * @param array $directories
  848. */
  849. public function registerDirs($directories){
  850. }
  851. /**
  852. * Register the autoload method
  853. */
  854. public function register(){
  855. }
  856. /**
  857. * Makes the work of autoload registered classes
  858. *
  859. * @param string $className
  860. */
  861. public function autoLoad($className){
  862. }
  863. }
  864. /**
  865. * Phalcon_Logger
  866. *
  867. * Phalcon_Logger is a component whose purpose is to create logs using
  868. * different backends via adapters, generating options, formats and filters
  869. * also implementing transactions.
  870. *
  871. *<code>
  872. *$logger = new Phalcon_Logger("File", "app/logs/test.log");
  873. *$logger->log("This is a message");
  874. *$logger->log("This is an error", Phalcon_Logger::ERROR);
  875. *$logger->error("This is another error");
  876. *$logger->close();
  877. * </code>
  878. */
  879. class Phalcon_Logger
  880. {
  881. const SPECIAL = 9;
  882. const CUSTOM = 8;
  883. const DEBUG = 7;
  884. const INFO = 6;
  885. const NOTICE = 5;
  886. const WARNING = 4;
  887. const ERROR = 3;
  888. const ALERT = 2;
  889. const CRITICAL = 1;
  890. const EMERGENCE = 0;
  891. /**
  892. * Phalcon_Logger constructor
  893. *
  894. * @param string $adapter
  895. * @param string $name
  896. * @param array $options
  897. */
  898. public function __construct($adapter='File', $name=NULL, $options=array ()){
  899. }
  900. /**
  901. * Sends/Writes a message to the log
  902. *
  903. * @param string $message
  904. * @param ing $type
  905. */
  906. public function log($message, $type=7){
  907. }
  908. /**
  909. * Sends/Writes a debug message to the log
  910. *
  911. * @param string $message
  912. * @param ing $type
  913. */
  914. public function debug($message){
  915. }
  916. /**
  917. * Sends/Writes an error message to the log
  918. *
  919. * @param string $message
  920. * @param ing $type
  921. */
  922. public function error($message){
  923. }
  924. /**
  925. * Sends/Writes an info message to the log
  926. *
  927. * @param string $message
  928. * @param ing $type
  929. */
  930. public function info($message){
  931. }
  932. /**
  933. * Sends/Writes a notice message to the log
  934. *
  935. * @param string $message
  936. * @param ing $type
  937. */
  938. public function notice($message){
  939. }
  940. /**
  941. * Sends/Writes a warning message to the log
  942. *
  943. * @param string $message
  944. * @param ing $type
  945. */
  946. public function warning($message){
  947. }
  948. /**
  949. * Sends/Writes an alert message to the log
  950. *
  951. * @param string $message
  952. * @param ing $type
  953. */
  954. public function alert($message){
  955. }
  956. /**
  957. * Pass any call to the internal adapter object
  958. *
  959. * @param string $method
  960. * @param array $arguments
  961. * @return mixed
  962. */
  963. public function __call($method, $arguments=array ()){
  964. }
  965. }
  966. /**
  967. * Phalcon_Paginator
  968. *
  969. * Phalcon_Paginator is designed to simplify building of pagination on views
  970. *
  971. * <code>
  972. *
  973. *
  974. * use Tag as Phalcon_Tag;
  975. *
  976. * $numberPage = (int) $_GET['page'];
  977. *
  978. * $paginator = Phalcon_Paginator::factory('Model', array(
  979. * 'data' => $robots,
  980. * 'limit' => 10,
  981. * 'page' => $numberPage
  982. * ));
  983. * $page = $paginator->getPaginate();
  984. * ?>
  985. *
  986. * <table>
  987. * <tr>
  988. * <th>Id</th>
  989. * <th>Name</th>
  990. * <th>Type</th>
  991. * </tr>
  992. * foreach($page->items as $item){ ?>
  993. * <tr>
  994. * <td> echo $item->id ?></td>
  995. * <td> echo $item->name ?></td>
  996. * <td> echo $item->type ?></td>
  997. * </tr>
  998. * } ?>
  999. * </table>
  1000. *
  1001. * <table>
  1002. * <tr>
  1003. * <td><?= Tag::linkTo("robots/search", "First") ?></td>
  1004. * <td><?= Tag::linkTo("robots/search?page=".$page->before, "Previous") ?></td>
  1005. * <td><?= Tag::linkTo("robots/search?page=".$page->next, "Next") ?></td>
  1006. * <td><?= Tag::linkTo("robots/search?page=".$page->last, "Last") ?></td>
  1007. * <td> echo $page->current, "/", $page->total_pages ?></td>
  1008. * </tr>
  1009. * </table>
  1010. * </code>
  1011. *
  1012. */
  1013. abstract class Phalcon_Paginator
  1014. {
  1015. /**
  1016. * Factories a paginator adapter
  1017. *
  1018. * @param string $adapterName
  1019. * @param array $options
  1020. * @return Object
  1021. */
  1022. public static function factory($adapterName, $options=array ()){
  1023. }
  1024. }
  1025. /**
  1026. * Phalcon_Request
  1027. *
  1028. * <p>Encapsulates request information for easy and secure access from application controllers.</p>
  1029. *
  1030. * <p>The request object is a simple value object that is passed between the dispatcher and controller classes.
  1031. * It packages the HTTP request environment.</p>
  1032. *
  1033. * <code>
  1034. *$request = Phalcon_Request::getInstance();
  1035. *if ($request->isPost() == true){
  1036. * if ($request->isAjax() == true){
  1037. * echo 'Request was made using POST and AJAX';
  1038. * }
  1039. *}
  1040. * </code>
  1041. *
  1042. */
  1043. class Phalcon_Request
  1044. {
  1045. /**
  1046. * Gets the singleton instance of Phalcon_Request
  1047. *
  1048. * @return Phalcon_Request
  1049. */
  1050. public static function getInstance(){
  1051. }
  1052. /**
  1053. * Overwrites Phalcon_Filter object used to sanitize input data
  1054. *
  1055. * @param Phalcon_Filter $filter
  1056. */
  1057. public function setFilter($filter){
  1058. }
  1059. /**
  1060. * Returns the active filter object used to sanitize input data
  1061. *
  1062. * @return Phalcon_Filter
  1063. */
  1064. protected function getFilter(){
  1065. }
  1066. /**
  1067. * Gets variable from $_POST superglobal applying filters if needed
  1068. *
  1069. * @param string $name
  1070. * @param string|array $filters
  1071. * @return mixed
  1072. */
  1073. public function getPost($name, $filters=NULL){
  1074. }
  1075. /**
  1076. * Gets variable from $_GET superglobal applying filters if needed
  1077. *
  1078. * @param string $name
  1079. * @param string|array $filters
  1080. * @return mixed
  1081. */
  1082. public function getQuery($name, $filters=NULL){
  1083. }
  1084. /**
  1085. * Gets variable from $_SERVER superglobal
  1086. *
  1087. * @param string $name
  1088. * @return mixed
  1089. */
  1090. public function getServer($name){
  1091. }
  1092. /**
  1093. * Checks whether $_POST superglobal has certain index
  1094. *
  1095. * @param string $name
  1096. * @return boolean
  1097. */
  1098. public function hasPost($name){
  1099. }
  1100. /**
  1101. * Checks whether $_SERVER superglobal has certain index
  1102. *
  1103. * @param string $name
  1104. * @return boolean
  1105. */
  1106. public function hasQuery($name){
  1107. }
  1108. /**
  1109. * Checks whether $_SERVER superglobal has certain index
  1110. *
  1111. * @param string $name
  1112. * @return mixed
  1113. */
  1114. public function hasServer($name){
  1115. }
  1116. /**
  1117. * Gets HTTP header from request data
  1118. *
  1119. * @param string $header
  1120. * @return string
  1121. */
  1122. public function getHeader($header){
  1123. }
  1124. /**
  1125. * Gets HTTP schema (http/https)
  1126. *
  1127. * @return string
  1128. */
  1129. public function getScheme(){
  1130. }
  1131. /**
  1132. * Checks whether request has been made using ajax
  1133. *
  1134. * @return boolean
  1135. */
  1136. public function isAjax(){
  1137. }
  1138. /**
  1139. * Checks whether request has been made using SOAP
  1140. *
  1141. * @return boolean
  1142. */
  1143. public function isSoapRequested(){
  1144. }
  1145. /**
  1146. * Checks whether request has been made using any secure layer
  1147. *
  1148. * @return boolean
  1149. */
  1150. public function isSecureRequest(){
  1151. }
  1152. /**
  1153. * Gets HTTP raws request body
  1154. *
  1155. * @return string
  1156. */
  1157. public function getRawBody(){
  1158. }
  1159. /**
  1160. * Gets active server address IP
  1161. *
  1162. * @return string
  1163. */
  1164. public function getServerAddress(){
  1165. }
  1166. /**
  1167. * Gets active server name
  1168. *
  1169. * @return string
  1170. */
  1171. public function getServerName(){
  1172. }
  1173. /**
  1174. * Gets information about schema, host and port used by the request
  1175. *
  1176. * @return string
  1177. */
  1178. public function getHttpHost(){
  1179. }
  1180. /**
  1181. * Gets most possibly client IPv4 Address
  1182. *
  1183. * @return string
  1184. */
  1185. public function getClientAddress(){
  1186. }
  1187. /**
  1188. * Gets HTTP method which request has been made
  1189. *
  1190. * @return string
  1191. */
  1192. public function getMethod(){
  1193. }
  1194. /**
  1195. * Gets HTTP user agent used to made the request
  1196. *
  1197. * @return string
  1198. */
  1199. public function getUserAgent(){
  1200. }
  1201. /**
  1202. * Checks whether HTTP method is POST
  1203. *
  1204. * @return boolean
  1205. */
  1206. public function isPost(){
  1207. }
  1208. /**
  1209. * Checks whether HTTP method is GET
  1210. *
  1211. * @return boolean
  1212. */
  1213. public function isGet(){
  1214. }
  1215. /**
  1216. * Checks whether HTTP method is PUT
  1217. *
  1218. * @return boolean
  1219. */
  1220. public function isPut(){
  1221. }
  1222. /**
  1223. * Checks whether HTTP method is HEAD
  1224. *
  1225. * @return boolean
  1226. */
  1227. public function isHead(){
  1228. }
  1229. /**
  1230. * Checks whether HTTP method is DELETE
  1231. *
  1232. * @return boolean
  1233. */
  1234. public function isDelete(){
  1235. }
  1236. /**
  1237. * Checks whether HTTP method is OPTIONS
  1238. *
  1239. * @return boolean
  1240. */
  1241. public function isOptions(){
  1242. }
  1243. /**
  1244. * Checks whether request include attached files
  1245. *
  1246. * @return boolean
  1247. */
  1248. public function hasFiles(){
  1249. }
  1250. /**
  1251. * Gets attached files as Phalcon_Request_File instances
  1252. *
  1253. * @return array
  1254. */
  1255. public function getUploadedFiles(){
  1256. }
  1257. /**
  1258. * Gets web page that refers active request. ie: http://www.google.com
  1259. *
  1260. * @return string
  1261. */
  1262. public function getHTTPReferer(){
  1263. }
  1264. protected function _getQualityHeader($serverIndex, $name){
  1265. }
  1266. protected function _getBestQuality($qualityParts, $name){
  1267. }
  1268. /**
  1269. * Gets array with mime/types and their quality accepted by the browser/client from $_SERVER['HTTP_ACCEPT']
  1270. *
  1271. * @return array
  1272. */
  1273. public function getAcceptableContent(){
  1274. }
  1275. /**
  1276. * Gets best mime/type accepted by the browser/client from $_SERVER['HTTP_ACCEPT']
  1277. *
  1278. * @return array
  1279. */
  1280. public function getBestAccept(){
  1281. }
  1282. /**
  1283. * Gets charsets array and their quality accepted by the browser/client from $_SERVER['HTTP_ACCEPT_CHARSET']
  1284. *
  1285. * @return array
  1286. */
  1287. public function getClientCharsets(){
  1288. }
  1289. /**
  1290. * Gets best charset accepted by the browser/client from $_SERVER['HTTP_ACCEPT_CHARSET']
  1291. *
  1292. * @return string
  1293. */
  1294. public function getBestCharset(){
  1295. }
  1296. /**
  1297. * Gets languages array and their quality accepted by the browser/client from $_SERVER['HTTP_ACCEPT_LANGUAGE']
  1298. *
  1299. * @return array
  1300. */
  1301. public function getLanguages(){
  1302. }
  1303. /**
  1304. * Gets best language accepted by the browser/client from $_SERVER['HTTP_ACCEPT_LANGUAGE']
  1305. *
  1306. * @return string
  1307. */
  1308. public function getBestLanguage(){
  1309. }
  1310. }
  1311. /**
  1312. * Phalcon_Response
  1313. *
  1314. * Encapsulates the HTTP response message.
  1315. *
  1316. *<code>
  1317. *$response = Phalcon_Response::getInstance();
  1318. *$response->setStatusCode(200, "OK");
  1319. *$response->setContent("<html><body>Hello</body></html>");
  1320. *$response->send();
  1321. *</code>
  1322. */
  1323. class Phalcon_Response
  1324. {
  1325. /**
  1326. * Returns singleton Phalcon_Response instance
  1327. *
  1328. * @return Phalcon_Response
  1329. */
  1330. public static function getInstance(){
  1331. }
  1332. /**
  1333. * Sets the HTTP response code
  1334. *
  1335. * @param int $code
  1336. * @param strign $message
  1337. */
  1338. public function setStatusCode($code, $message){
  1339. }
  1340. /**
  1341. * Overwrites a header in the response
  1342. *
  1343. *<code>
  1344. *$response->setHeader("Content-Type", "text/plain");
  1345. *</code>
  1346. *
  1347. * @param string $name
  1348. * @param string $value
  1349. */
  1350. public function setHeader($name, $value){
  1351. }
  1352. /**
  1353. * Send a raw header to the response
  1354. *
  1355. *<code>
  1356. *$response->setRawHeader("HTTP/1.1 404 Not Found");
  1357. *</code>
  1358. */
  1359. public function setRawHeader($header){
  1360. }
  1361. /**
  1362. * Sets HTTP response body
  1363. *
  1364. *<code>
  1365. *$response->setContent("<h1>Hello!</h1>");
  1366. *</code>
  1367. *
  1368. * @param string $content
  1369. */
  1370. public function setContent($content){
  1371. }
  1372. /**
  1373. * Appends a string to the HTTP response body
  1374. *
  1375. * @param string $content
  1376. */
  1377. public function appendContent($content){
  1378. }
  1379. /**
  1380. * Gets HTTP response body
  1381. *
  1382. * @return string
  1383. */
  1384. public function getContent(){
  1385. }
  1386. /**
  1387. * Sends HTTP response to the client
  1388. *
  1389. */
  1390. public function send(){
  1391. }
  1392. }
  1393. /**
  1394. * Phalcon_Session
  1395. *
  1396. * Session client-server persistent state data management.
  1397. */
  1398. abstract class Phalcon_Session
  1399. {
  1400. /**
  1401. * Starts session, optionally using an adapter
  1402. *
  1403. * @param array $options
  1404. */
  1405. public static function start($options=array ()){
  1406. }
  1407. /**
  1408. * Sets session options
  1409. *
  1410. * @param array $options
  1411. */
  1412. public static function setOptions($options){
  1413. }
  1414. /**
  1415. * Gets a session variable from an application context
  1416. *
  1417. * @param string $index
  1418. */
  1419. public static function get($index){
  1420. }
  1421. /**
  1422. * Sets a session variable in an application context
  1423. *
  1424. * @param string $index
  1425. * @param string $value
  1426. */
  1427. public static function set($index, $value){
  1428. }
  1429. /**
  1430. * Check whether a session variable is set in an application context
  1431. *
  1432. * @param string $index
  1433. */
  1434. public static function has($index){
  1435. }
  1436. /**
  1437. * Removes a session variable from an application context
  1438. *
  1439. * @param string $index
  1440. */
  1441. public static function remove($index){
  1442. }
  1443. /**
  1444. * Returns active session id
  1445. *
  1446. * @return string
  1447. */
  1448. public static function getId(){
  1449. }
  1450. }
  1451. /**
  1452. * Phalcon_Tag
  1453. *
  1454. * Phalcon_Tag is designed to simplify building of HTML tags.
  1455. * It provides a set of helpers to generate HTML in a dynamic way.
  1456. * This component is an abstract class that you can extend to add more helpers.
  1457. */
  1458. abstract class Phalcon_Tag
  1459. {
  1460. /**
  1461. * Sets the request dispatcher. A valid dispatcher is required to generate absolute paths
  1462. *
  1463. * @param Phalcon_Dispatcher $dispatcher
  1464. */
  1465. public static function setDispatcher($dispatcher){
  1466. }
  1467. /**
  1468. * Internally gets the request dispatcher
  1469. *
  1470. * @return Phalcon_Dispatcher
  1471. */
  1472. protected static function _getDispatcher(){
  1473. }
  1474. /**
  1475. * Assigns default values to generated tags by helpers
  1476. *
  1477. * <code>
  1478. * //Assigning "peter" to "name" component
  1479. * Phalcon_Tag::setDefault("name", "peter");
  1480. *
  1481. * //Later in the view
  1482. * echo Phalcon_Tag::textField("name"); //Will have the value "peter" by default
  1483. * </code>
  1484. *
  1485. * @param string $id
  1486. * @param string $value
  1487. */
  1488. public static function setDefault($id, $value){
  1489. }
  1490. /**
  1491. * Alias of Phalcon_Tag::setDefault
  1492. *
  1493. * @param string $id
  1494. * @param string $value
  1495. */
  1496. public static function displayTo($id, $value){
  1497. }
  1498. /**
  1499. * Every helper calls this function to check whether a component has a predefined
  1500. * value using Phalcon_Tag::displayTo or value from $_POST
  1501. *
  1502. * @param string $name
  1503. * @return mixed
  1504. */
  1505. public static function getValue($name){
  1506. }
  1507. /**
  1508. * Resets the request and internal values to avoid those fields will have any default value
  1509. */
  1510. public static function resetInput(){
  1511. }
  1512. /**
  1513. * Builds a HTML A tag using framework conventions
  1514. *
  1515. * <code>echo Phalcon_Tag::linkTo('signup/register', 'Register Here!')</code>
  1516. *
  1517. * @param array $parameters
  1518. * @return string
  1519. */
  1520. public static function linkTo($parameters, $text=NULL){
  1521. }
  1522. /**
  1523. * Builds generic INPUT tags
  1524. *
  1525. * @param string $type
  1526. * @param array $parameters
  1527. * @return string
  1528. */
  1529. protected static function _inputField($type, $parameters){
  1530. }
  1531. /**
  1532. * Builds a HTML input[type="text"] tag
  1533. *
  1534. * <code>echo Phalcon_Tag::textField(array("name", "size" => 30))</code>
  1535. *
  1536. * @param array $parameters
  1537. * @return string
  1538. */
  1539. public static function textField($parameters){
  1540. }
  1541. /**
  1542. * Builds a HTML input[type="password"] tag
  1543. *
  1544. * <code>echo Phalcon_Tag::passwordField(array("name", "size" => 30))</code>
  1545. *
  1546. * @param array $parameters
  1547. * @return string
  1548. */
  1549. public static function passwordField($parameters){
  1550. }
  1551. /**
  1552. * Builds a HTML input[type="hidden"] tag
  1553. *
  1554. * <code>echo Phalcon_Tag::hiddenField(array("name", "value" => "mike"))</code>
  1555. *
  1556. * @param array $parameters
  1557. * @return string
  1558. */
  1559. public static function hiddenField($parameters){
  1560. }
  1561. /**
  1562. * Builds a HTML input[type="file"] tag
  1563. *
  1564. * <code>echo Phalcon_Tag::fileField("file")</code>
  1565. *
  1566. * @param array $parameters
  1567. * @return string
  1568. */
  1569. public static function fileField($parameters){
  1570. }
  1571. /**
  1572. * Builds a HTML input[type="check"] tag
  1573. *
  1574. * <code>echo Phalcon_Tag::checkField(array("name", "size" => 30))</code>
  1575. *
  1576. * @param array $parameters
  1577. * @return string
  1578. */
  1579. public static function checkField($parameters){
  1580. }
  1581. /**
  1582. * Builds a HTML input[type="submit"] tag
  1583. *
  1584. * <code>echo Phalcon_Tag::submitButton("Save")</code>
  1585. *
  1586. * @param array $params
  1587. * @return string
  1588. */
  1589. public static function submitButton($parameters){
  1590. }
  1591. /**
  1592. * Builds a HTML SELECT tag using a PHP array for options
  1593. *
  1594. * <code>echo Phalcon_Tag::selectStatic("status", array("A" => "Active", "I" => "Inactive"))</code>
  1595. *
  1596. * @param array $parameters
  1597. * @return string
  1598. */
  1599. public static function selectStatic($parameters, $data=NULL){
  1600. }
  1601. /**
  1602. * Builds a HTML SELECT tag using a Phalcon_Model resultset as options
  1603. *
  1604. * <code>echo Phalcon_Tag::selectStatic(array(
  1605. * "robotId",
  1606. * Robots::find("type = 'mechanical'"),
  1607. * "using" => array("id", "name")
  1608. * ))</code>
  1609. *
  1610. * @param array $params
  1611. * @return string
  1612. */
  1613. public static function select($parameters, $data=NULL){
  1614. }
  1615. /**
  1616. * Builds a HTML TEXTAREA tag
  1617. *
  1618. * <code>echo Phalcon_Tag::textArea(array("comments", "cols" => 10, "rows" => 4))</code>
  1619. *
  1620. * @param array $parameters
  1621. * @return string
  1622. */
  1623. public static function textArea($parameters){
  1624. }
  1625. /**
  1626. * Builds a HTML FORM tag
  1627. *
  1628. * <code>
  1629. * echo Phalcon_Tag::form("posts/save");
  1630. * echo Phalcon_Tag::form(array("posts/save", "method" => "post"));
  1631. * </code>
  1632. *
  1633. * @param array $parameters
  1634. * @return string
  1635. */
  1636. public static function form($parameters=NULL){
  1637. }
  1638. /**
  1639. * Builds a HTML close FORM tag
  1640. *
  1641. * @return string
  1642. */
  1643. public static function endForm(){
  1644. }
  1645. /**
  1646. * Set the title of view content
  1647. *
  1648. * @param string $title
  1649. */
  1650. public static function setTitle($title){
  1651. }
  1652. /**
  1653. * Add to title of view content
  1654. *
  1655. * @param string $title
  1656. */
  1657. public static function appendTitle($title){
  1658. }
  1659. /**
  1660. * Add before the title of view content
  1661. *
  1662. * @param string $title
  1663. */
  1664. public static function prependTitle($title){
  1665. }
  1666. /**
  1667. * Get the title of view content
  1668. *
  1669. * @return string
  1670. */
  1671. public static function getTitle(){
  1672. }
  1673. /**
  1674. * Builds a LINK[rel="stylesheet"] tag
  1675. *
  1676. * <code>
  1677. * echo Phalcon_Tag::stylesheetLink("http://fonts.googleapis.com/css?family=Rosario", false);
  1678. * echo Phalcon_Tag::stylesheetLink("css/style.css");
  1679. * </code>
  1680. *
  1681. * @param array $parameters
  1682. * @param boolean $local
  1683. * @return string
  1684. */
  1685. public static function stylesheetLink($parameters=NULL, $local=true){
  1686. }
  1687. /**
  1688. * Builds a SCRIPT[type="javascript"] tag
  1689. *
  1690. * <code>
  1691. * echo Phalcon_Tag::javascriptInclude("http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", false);
  1692. * echo Phalcon_Tag::javascriptInclude("javascript/jquery.js");
  1693. * </code>
  1694. *
  1695. * @param array $parameters
  1696. * @param boolean $local
  1697. * @return string
  1698. */
  1699. public static function javascriptInclude($parameters=NULL, $local=true){
  1700. }
  1701. /**
  1702. * Builds HTML IMG tags
  1703. *
  1704. * @param array $parameters
  1705. * @return string
  1706. */
  1707. public static function image($parameters=NULL){
  1708. }
  1709. }
  1710. class Phalcon_Text
  1711. {
  1712. /**
  1713. * Converts strings to camelize style
  1714. *
  1715. * <code>Phalcon_Utils::camelize('coco_bongo'); //CocoBongo</code>
  1716. *
  1717. * @param string $str
  1718. * @return string
  1719. */
  1720. public static function camelize($str){
  1721. }
  1722. /**
  1723. * Uncamelize strings which are camelized
  1724. *
  1725. * <code>Phalcon_Utils::camelize('CocoBongo'); //coco_bongo</code>
  1726. *
  1727. * @param string $str
  1728. * @return string
  1729. */
  1730. public static function uncamelize($str){
  1731. }
  1732. /**
  1733. * Changes only first letter to lowercase
  1734. *
  1735. * @param string $str
  1736. * @return string
  1737. * @static
  1738. **/
  1739. public static function lcfirst($str){
  1740. }
  1741. }
  1742. /**
  1743. * Phalcon_Transaction
  1744. *
  1745. * Transactions are protective blocks where SQL statements are only permanent if they can
  1746. * all succeed as one atomic action. Phalcon_Transaction is intended to be used with Phalcon_Model_Base.
  1747. * Phalcon Transactions should be created using Phalcon_Transaction_Manager.
  1748. *
  1749. *<code>
  1750. *try {
  1751. *
  1752. * $transaction = Phalcon_Transaction_Manager::get();
  1753. *
  1754. * $robot = new Robots();
  1755. * $robot->setTransaction($transaction);
  1756. * $robot->name = 'WALL·E';
  1757. * $robot->created_at = date('Y-m-d');
  1758. * if($robot->save()==false){
  1759. * $transaction->rollback("Can't save robot");
  1760. * }
  1761. *
  1762. * $robotPart = new RobotParts();
  1763. * $robotPart->setTransaction($transaction);
  1764. * $robotPart->type = 'head';
  1765. * if($robotPart->save()==false){
  1766. * $transaction->rollback("Can't save robot part");
  1767. * }
  1768. *
  1769. * $transaction->commit();
  1770. *
  1771. *}
  1772. *catch(Phalcon_Transaction_Failed $e){
  1773. * echo 'Failed, reason: ', $e->getMessage();
  1774. *}
  1775. *
  1776. *</code>
  1777. */
  1778. class Phalcon_Transaction
  1779. {
  1780. /**
  1781. * Phalcon_Transaction constructor
  1782. *
  1783. * @param boolean $autoBegin
  1784. */
  1785. public function __construct($autoBegin=false){
  1786. }
  1787. /**
  1788. * Sets transaction manager related to the transaction
  1789. *
  1790. * @param Phalcon_Transaction_Manager $manager
  1791. */
  1792. public function setTransactionManager($manager){
  1793. }
  1794. /**
  1795. * Starts the transaction
  1796. */
  1797. public function begin(){
  1798. }
  1799. /**
  1800. * Commits the transaction
  1801. *
  1802. * @return boolean
  1803. */
  1804. public function commit(){
  1805. }
  1806. /**
  1807. * Rollbacks the transaction
  1808. *
  1809. * @param string $rollbackMessage
  1810. * @param Phalcon_Model_Base $rollbackRecord
  1811. * @return boolean
  1812. */
  1813. public function rollback($rollbackMessage=NULL, $rollbackRecord=NULL){
  1814. }
  1815. /**
  1816. * Returns connection related to transaction
  1817. *
  1818. * @return Phalcon_Db
  1819. */
  1820. public function getConnection(){
  1821. }
  1822. /**
  1823. * Sets if is a reused transaction or new once
  1824. *
  1825. * @param boolean $isNew
  1826. */
  1827. public function setIsNewTransaction($isNew){
  1828. }
  1829. /**
  1830. * Sets flag to rollback on abort the HTTP connection
  1831. *
  1832. * @param boolean $rollbackOnAbort
  1833. */
  1834. public function setRollbackOnAbort($rollbackOnAbort){
  1835. }
  1836. /**
  1837. * Checks whether transaction is managed by a transaction manager
  1838. *
  1839. * @return boolean
  1840. */
  1841. public function isManaged(){
  1842. }
  1843. /**
  1844. * Changes dependency internal pointer
  1845. *
  1846. * @param int $pointer
  1847. */
  1848. public function setDependencyPointer($pointer){
  1849. }
  1850. /**
  1851. * Attaches Phalcon_Model_Base object to the active transaction
  1852. *
  1853. * @param int $pointer
  1854. * @param Phalcon_Model_Base $object
  1855. */
  1856. public function attachDependency($pointer, $object){
  1857. }
  1858. /**
  1859. * Make a bulk save on all attached objects
  1860. *
  1861. * @return boolean
  1862. */
  1863. public function save(){
  1864. }
  1865. /**
  1866. * Returns validations messages from last save try
  1867. *
  1868. * @return array
  1869. */
  1870. public function getMessages(){
  1871. }
  1872. /**
  1873. * Checks whether internal connection is under an active transaction
  1874. *
  1875. * @return boolean
  1876. */
  1877. public function isValid(){
  1878. }
  1879. /**
  1880. * Sets object which generates rollback action
  1881. *
  1882. * @param Phalcon_Model_Base $record
  1883. */
  1884. public function setRollbackedRecord($record){
  1885. }
  1886. }
  1887. /**
  1888. * Phalcon_Translate
  1889. *
  1890. * Translate component allows the creation of multi-language applications using
  1891. * different adapters for translation lists.
  1892. */
  1893. class Phalcon_Translate implements ArrayAccess
  1894. {
  1895. /**
  1896. * Phalcon_Translate constructor
  1897. *
  1898. * @param string $adapter
  1899. * @param array $options
  1900. */
  1901. public function __construct($adapter, $options){
  1902. }
  1903. /**
  1904. * Returns the translation string of the given key
  1905. *
  1906. * @param string $translateKey
  1907. * @return string
  1908. */
  1909. public function _($translateKey){
  1910. }
  1911. /**
  1912. * Sets a translation value
  1913. *
  1914. * @param string $offset
  1915. * @param string $value
  1916. */
  1917. public function offsetSet($offset, $value){
  1918. }
  1919. /**
  1920. * Check whether a translation key exists
  1921. *
  1922. * @param string $translateKey
  1923. * @return boolean
  1924. */
  1925. public function offsetExists($translateKey){
  1926. }
  1927. /**
  1928. * Elimina un indice del diccionario
  1929. *
  1930. * @param string $offset
  1931. */
  1932. public function offsetUnset($offset){
  1933. }
  1934. /**
  1935. * Returns the translation related to the given key
  1936. *
  1937. * @param string $traslateKey
  1938. * @return string
  1939. */
  1940. public function offsetGet($traslateKey){
  1941. }
  1942. }
  1943. /**
  1944. * Phalcon_Utils
  1945. *
  1946. * Implements functionality used widely by the framework
  1947. */
  1948. class Phalcon_Utils
  1949. {
  1950. /**
  1951. * This function is now deprecated, use Phalcon_Text::camelize instead
  1952. *
  1953. * @param string $str
  1954. * @return string
  1955. */
  1956. public static function camelize($str){
  1957. }
  1958. /**
  1959. * This function is now deprecated, use Phalcon_Text::uncamelize instead
  1960. *
  1961. * @param string $str
  1962. * @return string
  1963. */
  1964. public static function uncamelize($str){
  1965. }
  1966. /**
  1967. * This function is now deprecated, use Phalcon_Text::lcfirst instead
  1968. *
  1969. * @param string $str
  1970. * @return string
  1971. */
  1972. public static function lcfirst($str){
  1973. }
  1974. /**
  1975. * Gets public URL to phalcon instance
  1976. *
  1977. * @param string $uri
  1978. * @return string
  1979. */
  1980. public static function getUrl($uri=''){
  1981. }
  1982. /**
  1983. * Gets path to local file
  1984. *
  1985. * @param string $extraPath
  1986. * @return string
  1987. */
  1988. public static function getLocalPath($extraPath=''){
  1989. }
  1990. }
  1991. /**
  1992. * Phalcon_View
  1993. *
  1994. * Phalcon_View is a class for working with the "view" portion of the model-view-controller pattern.
  1995. * That is, it exists to help keep the view script separate from the model and controller scripts.
  1996. * It provides a system of helpers, output filters, and variable escaping.
  1997. *
  1998. * <code>
  1999. * //Setting views directory
  2000. * $view = new Phalcon_View();
  2001. * $view->setViewsDir('app/views/');
  2002. *
  2003. * $view->start();
  2004. * //Shows recent posts view (app/views/posts/recent.phtml)
  2005. * $view->render('posts', 'recent');
  2006. * $view->finish();
  2007. *
  2008. * //Printing views output
  2009. * echo $view->getContent();
  2010. * </code>
  2011. */
  2012. class Phalcon_View
  2013. {
  2014. const LEVEL_MAIN_LAYOUT = 5;
  2015. const LEVEL_AFTER_TEMPLATE = 4;
  2016. const LEVEL_LAYOUT = 3;
  2017. const LEVEL_BEFORE_TEMPLATE = 2;
  2018. const LEVEL_ACTION_VIEW = 1;
  2019. const LEVEL_NO_RENDER = 0;
  2020. /**
  2021. * Sets views directory. Depending of your platform, always add a trailing slash or backslash
  2022. *
  2023. * @param string $viewsDir
  2024. */
  2025. public function setViewsDir($viewsDir){
  2026. }
  2027. /**
  2028. * Gets views directory
  2029. *
  2030. * @return string
  2031. */
  2032. public function getViewsDir(){
  2033. }
  2034. /**
  2035. * Sets base path. Depending of your platform, always add a trailing slash or backslash
  2036. */
  2037. public function setBasePath($basePath){
  2038. }
  2039. /**
  2040. * Sets the render level for the view
  2041. *
  2042. * @param string $level
  2043. */
  2044. public function setRenderLevel($level){
  2045. }
  2046. /**
  2047. * Sets default view name. Must be a file without extension in the views directory
  2048. *
  2049. * @param string $name
  2050. */
  2051. public function setMainView($viewPath){
  2052. }
  2053. /**
  2054. * Appends template before controller layout
  2055. *
  2056. * @param string|array $templateBefore
  2057. */
  2058. public function setTemplateBefore($templateBefore){
  2059. }
  2060. /**
  2061. * Resets any template before layouts
  2062. *
  2063. */
  2064. public function cleanTemplateBefore(){
  2065. }
  2066. /**
  2067. * Appends template after controller layout
  2068. *
  2069. * @param string|array $templateAfter
  2070. */
  2071. public function setTemplateAfter($templateAfter){
  2072. }
  2073. /**
  2074. * Resets any template before layouts
  2075. *
  2076. */
  2077. public function cleanTemplateAfter(){
  2078. }
  2079. /**
  2080. * Adds parameters to views (alias of setVar)
  2081. *
  2082. * @param string $key
  2083. * @param mixed $value
  2084. */
  2085. public function setParamToView($key, $value){
  2086. }
  2087. /**
  2088. * Adds parameters to views
  2089. *
  2090. * @param string $key
  2091. * @param mixed $value
  2092. */
  2093. public function setVar($key, $value){
  2094. }
  2095. /**
  2096. * Returns parameters to views
  2097. *
  2098. * @return array
  2099. */
  2100. public function getParamsToView(){
  2101. }
  2102. /**
  2103. * Gets the name of the controller rendered
  2104. *
  2105. * @return string
  2106. */
  2107. public function getControllerName(){
  2108. }
  2109. /**
  2110. * Gets the name of the action rendered
  2111. *
  2112. * @return string
  2113. */
  2114. public function getActionName(){
  2115. }
  2116. /**
  2117. * Gets extra parameters of the action rendered
  2118. */
  2119. public function getParams(){
  2120. }
  2121. /**
  2122. * Starts rendering process
  2123. */
  2124. public function start(){
  2125. }
  2126. /**
  2127. * Loads registered template engines, if none is registered use Phalcon_View_Engine_Php
  2128. *
  2129. * @return array
  2130. */
  2131. protected function _loadTemplateEngines(){
  2132. }
  2133. /**
  2134. * Checks whether view exists on registered extensions and render it
  2135. */
  2136. protected function _engineRender($engines, $viewPath, $silence){
  2137. }
  2138. /**
  2139. * Register templating engines
  2140. *
  2141. * @param array $engines
  2142. */
  2143. public function registerEngines($engines){
  2144. }
  2145. /**
  2146. * Executes render process from request data
  2147. *
  2148. * @param string $controllerName
  2149. * @param string $actionName
  2150. * @param array $params
  2151. */
  2152. public function render($controllerName, $actionName, $params=array ()){
  2153. }
  2154. /**
  2155. * Renders a partial view
  2156. *
  2157. * @param string $partialPath
  2158. */
  2159. public function partial($partialPath){
  2160. }
  2161. /**
  2162. * Finishes the render process
  2163. */
  2164. public function finish(){
  2165. }
  2166. /**
  2167. * Set externally the view content
  2168. *
  2169. * @param string $content
  2170. */
  2171. public function setContent($content){
  2172. }
  2173. /**
  2174. * Returns cached ouput on another view stage
  2175. *
  2176. * @return string
  2177. */
  2178. public function getContent(){
  2179. }
  2180. }
  2181. /**
  2182. * Phalcon_Acl_Exception
  2183. *
  2184. * Class for exceptions thrown by Phalcon_Acl
  2185. */
  2186. class Phalcon_Acl_Exception extends Php_Exception
  2187. {
  2188. final private function __clone(){
  2189. }
  2190. public function __construct($message, $code, $previous){
  2191. }
  2192. final public function getMessage(){
  2193. }
  2194. final public function getCode(){
  2195. }
  2196. final public function getFile(){
  2197. }
  2198. final public function getLine(){
  2199. }
  2200. final public function getTrace(){
  2201. }
  2202. final public function getPrevious(){
  2203. }
  2204. final public function getTraceAsString(){
  2205. }
  2206. public function __toString(){
  2207. }
  2208. }
  2209. /**
  2210. *
  2211. * Phalcon_Acl_Resource
  2212. *
  2213. * This class defines resource entity and its description
  2214. *
  2215. */
  2216. class Phalcon_Acl_Resource
  2217. {
  2218. /**
  2219. * Phalcon_Acl_Resource description
  2220. *
  2221. * @param string $name
  2222. * @param string $description
  2223. */
  2224. public function __construct($name, $description=NULL){
  2225. }
  2226. /**
  2227. * Returns the resource name
  2228. *
  2229. * @return string
  2230. */
  2231. public function getName(){
  2232. }
  2233. /**
  2234. * Returns resource description
  2235. *
  2236. * @return string
  2237. */
  2238. public function getDescription(){
  2239. }
  2240. }
  2241. /**
  2242. *
  2243. * Phalcon_Acl_Role
  2244. *
  2245. * This class defines role entity and its description
  2246. *
  2247. */
  2248. class Phalcon_Acl_Role
  2249. {
  2250. /**
  2251. * Phalcon_Acl_Role description
  2252. *
  2253. * @param string $name
  2254. * @param string $description
  2255. */
  2256. public function __construct($name, $description=''){
  2257. }
  2258. /**
  2259. * Returns the role name
  2260. *
  2261. * @return string
  2262. */
  2263. public function getName(){
  2264. }
  2265. /**
  2266. * Returns role description
  2267. *
  2268. * @return string
  2269. */
  2270. public function getDescription(){
  2271. }
  2272. }
  2273. /**
  2274. * Phalcon_Acl_Adapter_Memory
  2275. *
  2276. * Manages ACL lists in memory
  2277. */
  2278. class Phalcon_Acl_Adapter_Memory
  2279. {
  2280. /**
  2281. * Permisos de la Lista de Acceso
  2282. *
  2283. * @var array
  2284. */
  2285. public $_access;
  2286. /**
  2287. * Sets the default access level (Phalcon_Acl::ALLOW or Phalcon_Acl::DENY)
  2288. */
  2289. public function setDefaultAction($defaultAccess){
  2290. }
  2291. /**
  2292. * Returns the default ACL access level
  2293. */
  2294. public function getDefaultAction(){
  2295. }
  2296. /**
  2297. * Adds a role to the ACL list. Second parameter lets to inherit access data from other existing role
  2298. *
  2299. * Example:
  2300. * <code>$acl->addRole(new Phalcon_Acl_Role('administrator'), 'consultor');</code>
  2301. * <code>$acl->addRole('administrator', 'consultor');</code>
  2302. *
  2303. * @param string $roleObject
  2304. * @param array $accessInherits
  2305. * @return boolean
  2306. */
  2307. public function addRole($roleObject, $accessInherits=NULL){
  2308. }
  2309. /**
  2310. * Do a role inherit from another existing role
  2311. *
  2312. * @param string $roleName
  2313. * @param string $roleToInherit
  2314. */
  2315. public function addInherit($roleName, $roleToInherit){
  2316. }
  2317. /**
  2318. * Check whether role exist in the roles list
  2319. *
  2320. * @param string $roleName
  2321. * @return boolean
  2322. */
  2323. public function isRole($roleName){
  2324. }
  2325. /**
  2326. * Check whether resource exist in the resources list
  2327. *
  2328. * @param string $resourceName
  2329. * @return boolean
  2330. */
  2331. public function isResource($resourceName){
  2332. }
  2333. /**
  2334. * Adds a resource to the ACL list
  2335. *
  2336. * Access names can be a particular action, by example
  2337. * search, update, delete, etc or a list of them
  2338. *
  2339. * Example:
  2340. * <code>
  2341. * //Add a resource to the the list allowing access to an action
  2342. * $acl->addResource(new Phalcon_Acl_Resource('customers'), 'search');
  2343. * $acl->addResource('customers', 'search');
  2344. *
  2345. * //Add a resource with an access list
  2346. * $acl->addResource(new Phalcon_Acl_Resource('customers'), array('create', 'search'));
  2347. * $acl->addResource('customers', array('create', 'search'));
  2348. * </code>
  2349. *
  2350. * @param Phalcon_Acl_Resource $resource
  2351. * @return boolean
  2352. */
  2353. public function addResource($resource, $accessList=array ()){
  2354. }
  2355. /**
  2356. * Adds access to resources
  2357. *
  2358. * @param string $resourceName
  2359. * @param mixed $accessList
  2360. */
  2361. public function addResourceAccess($resourceName, $accessList){
  2362. }
  2363. /**
  2364. * Removes an access from a resource
  2365. *
  2366. * @param string $resourceName
  2367. * @param mixed $accessList
  2368. */
  2369. public function dropResourceAccess($resourceName, $accessList){
  2370. }
  2371. protected function _allowOrDeny($roleName, $resourceName, $access, $action){
  2372. }
  2373. /**
  2374. * Allow access to a role on a resource
  2375. *
  2376. * You can use '*' as wildcard
  2377. *
  2378. * Ej:
  2379. * <code>
  2380. * //Allow access to guests to search on customers
  2381. * $acl->allow('guests', 'customers', 'search');
  2382. *
  2383. * //Allow access to guests to search or create on customers
  2384. * $acl->allow('guests', 'customers', array('search', 'create'));
  2385. *
  2386. * //Allow access to any role to browse on products
  2387. * $acl->allow('*', 'products', 'browse');
  2388. *
  2389. * //Allow access to any role to browse on any resource
  2390. * $acl->allow('*', '*', 'browse');
  2391. * </code>
  2392. *
  2393. * @param string $roleName
  2394. * @param string $resourceName
  2395. * @param mixed $access
  2396. */
  2397. public function allow($roleName, $resourceName, $access){
  2398. }
  2399. /**
  2400. * Deny access to a role on a resource
  2401. *
  2402. * You can use '*' as wildcard
  2403. *
  2404. * Ej:
  2405. * <code>
  2406. * //Deny access to guests to search on customers
  2407. * $acl->deny('guests', 'customers', 'search');
  2408. *
  2409. * //Deny access to guests to search or create on customers
  2410. * $acl->deny('guests', 'customers', array('search', 'create'));
  2411. *
  2412. * //Deny access to any role to browse on products
  2413. * $acl->deny('*', 'products', 'browse');
  2414. *
  2415. * //Deny access to any role to browse on any resource
  2416. * $acl->deny('*', '*', 'browse');
  2417. * </code>
  2418. *
  2419. * @param string $roleName
  2420. * @param string $resourceName
  2421. * @param mixed $access
  2422. * @return boolean
  2423. */
  2424. public function deny($roleName, $resourceName, $access){
  2425. }
  2426. /**
  2427. * Check whether a role is allowed to access an action from a resource
  2428. *
  2429. * <code>
  2430. * //Does andres have access to the customers resource to create?
  2431. * $acl->isAllowed('andres', 'Products', 'create');
  2432. *
  2433. * //Do guests have access to any resource to edit?
  2434. * $acl->isAllowed('guests', '*', 'edit');
  2435. * </code>
  2436. *
  2437. * @param string $role
  2438. * @param string $resource
  2439. * @param mixed $accessList
  2440. * @return boolean
  2441. */
  2442. public function isAllowed($role, $resource, $access){
  2443. }
  2444. /**
  2445. * Rebuild the list of access from the inherit lists
  2446. *
  2447. */
  2448. protected function _rebuildAccessList(){
  2449. }
  2450. }
  2451. /**
  2452. * Phalcon_Cache_Exception
  2453. *
  2454. * Exceptions thrown in Phalcon_Cache will use this class
  2455. *
  2456. */
  2457. class Phalcon_Cache_Exception extends Php_Exception
  2458. {
  2459. final private function __clone(){
  2460. }
  2461. public function __construct($message, $code, $previous){
  2462. }
  2463. final public function getMessage(){
  2464. }
  2465. final public function getCode(){
  2466. }
  2467. final public function getFile(){
  2468. }
  2469. final public function getLine(){
  2470. }
  2471. final public function getTrace(){
  2472. }
  2473. final public function getPrevious(){
  2474. }
  2475. final public function getTraceAsString(){
  2476. }
  2477. public function __toString(){
  2478. }
  2479. }
  2480. /**
  2481. * Phalcon_Cache_Backend_Apc
  2482. *
  2483. * Allows to cache output fragments using a memcache backend
  2484. *
  2485. *<code>
  2486. *
  2487. * //Cache data for 2 days
  2488. *$frontendOptions = array(
  2489. * 'lifetime' => 172800
  2490. *);
  2491. *
  2492. *$cache = Phalcon_Cache::factory('Data', 'Apc', $frontendOptions, array());
  2493. *
  2494. * //Cache arbitrary data
  2495. *$cache->store('my-data', array(1, 2, 3, 4, 5));
  2496. *
  2497. * //Get data
  2498. *$data = $cache->get('my-data');
  2499. *
  2500. *</code>
  2501. */
  2502. class Phalcon_Cache_Backend_Apc
  2503. {
  2504. /**
  2505. * Phalcon_Backend_Adapter_Apc constructor
  2506. *
  2507. * @param mixed $frontendObject
  2508. * @param array $backendOptions
  2509. */
  2510. public function __construct($frontendObject, $backendOptions){
  2511. }
  2512. /**
  2513. * Starts a cache. The $keyname allow to identify the created fragment
  2514. *
  2515. * @param string $keyName
  2516. * @return mixed
  2517. */
  2518. public function start($keyName){
  2519. }
  2520. /**
  2521. * Returns a cached content
  2522. *
  2523. * @param string $keyName
  2524. * @return mixed
  2525. */
  2526. public function get($keyName){
  2527. }
  2528. /**
  2529. * Stores cached content into the file backend
  2530. *
  2531. * @param string $keyName
  2532. * @param string $content
  2533. * @param boolean $stopBuffer
  2534. */
  2535. public function save($keyName=NULL, $content=NULL, $stopBuffer=true){
  2536. }
  2537. /**
  2538. * Deletes a value from the cache by its key
  2539. *
  2540. * @return boolean
  2541. */
  2542. public function delete($keyName){
  2543. }
  2544. /**
  2545. * Returns front-end instance adapter related to the back-end
  2546. *
  2547. * @return mixed
  2548. */
  2549. public function getFrontend(){
  2550. }
  2551. }
  2552. /**
  2553. * Phalcon_Cache_Backend_File
  2554. *
  2555. * Allows to cache output fragments using a file backend
  2556. *
  2557. *<code>
  2558. * //Cache the file for 2 days
  2559. *$frontendOptions = array(
  2560. * 'lifetime' => 172800
  2561. *);
  2562. *
  2563. * //Set the cache directory
  2564. *$backendOptions = array(
  2565. * 'cacheDir' => '../app/cache/'
  2566. *);
  2567. *
  2568. *$cache = Phalcon_Cache::factory('Output', 'File', $frontendOptions, $backendOptions);
  2569. *
  2570. *$content = $cache->start('my-cache');
  2571. *if($content===null){
  2572. * echo '<h1>', time(), '</h1>';
  2573. * $cache->save();
  2574. *} else {
  2575. * echo $content;
  2576. *}
  2577. *</code>
  2578. */
  2579. class Phalcon_Cache_Backend_File
  2580. {
  2581. /**
  2582. * Phalcon_Backend_Adapter_File constructor
  2583. *
  2584. * @param mixed $frontendObject
  2585. * @param array $backendOptions
  2586. */
  2587. public function __construct($frontendObject, $backendOptions){
  2588. }
  2589. /**
  2590. * Starts a cache. The $keyname allow to identify the created fragment
  2591. *
  2592. * @param string $keyName
  2593. * @return mixed
  2594. */
  2595. public function start($keyName){
  2596. }
  2597. /**
  2598. * Returns a cached content
  2599. *
  2600. * @param string $keyName
  2601. * @return mixed
  2602. */
  2603. public function get($keyName){
  2604. }
  2605. /**
  2606. * Stores cached content into the file backend
  2607. *
  2608. * @param string $keyName
  2609. * @param string $content
  2610. * @param boolean $stopBuffer
  2611. */
  2612. public function save($keyName=NULL, $content=NULL, $stopBuffer=true){
  2613. }
  2614. /**
  2615. * Deletes a value from the cache by its key
  2616. *
  2617. * @return boolean
  2618. */
  2619. public function delete($keyName){
  2620. }
  2621. /**
  2622. * Returns front-end instance adapter related to the back-end
  2623. *
  2624. * @return mixed
  2625. */
  2626. public function getFrontend(){
  2627. }
  2628. }
  2629. /**
  2630. * Phalcon_Cache_Backend_Memcache
  2631. *
  2632. * Allows to cache output fragments using a memcache backend
  2633. *
  2634. *<code>
  2635. *
  2636. * //Cache data for 2 days
  2637. *$frontendOptions = array(
  2638. * 'lifetime' => 172800
  2639. *);
  2640. *
  2641. * //Set memcached server connection settings
  2642. *$backendOptions = array(
  2643. * 'host' => 'localhost',
  2644. * 'port' => 11211
  2645. *);
  2646. *
  2647. *$cache = Phalcon_Cache::factory('Data', 'Memcache', $frontendOptions, $backendOptions);
  2648. *
  2649. * //Cache arbitrary data
  2650. *$cache->store('my-data', array(1, 2, 3, 4, 5));
  2651. *
  2652. * //Get data
  2653. *$data = $cache->get('my-data');
  2654. *
  2655. *</code>
  2656. */
  2657. class Phalcon_Cache_Backend_Memcache
  2658. {
  2659. /**
  2660. * Phalcon_Backend_Adapter_Memcache constructor
  2661. *
  2662. * @param mixed $frontendObject
  2663. * @param array $backendOptions
  2664. */
  2665. public function __construct($frontendObject, $backendOptions){
  2666. }
  2667. /**
  2668. * Create internal connection to memcached
  2669. */
  2670. protected function _connect(){
  2671. }
  2672. /**
  2673. * Starts a cache. The $keyname allow to identify the created fragment
  2674. *
  2675. * @param string $keyName
  2676. * @return mixed
  2677. */
  2678. public function start($keyName){
  2679. }
  2680. /**
  2681. * Returns a cached content
  2682. *
  2683. * @param string $keyName
  2684. * @return mixed
  2685. */
  2686. public function get($keyName){
  2687. }
  2688. /**
  2689. * Stores cached content into the file backend
  2690. *
  2691. * @param string $keyName
  2692. * @param string $content
  2693. * @param boolean $stopBuffer
  2694. */
  2695. public function save($keyName=NULL, $content=NULL, $stopBuffer=true){
  2696. }
  2697. /**
  2698. * Deletes a value from the cache by its key
  2699. *
  2700. * @return boolean
  2701. */
  2702. public function delete($keyName){
  2703. }
  2704. /**
  2705. * Returns front-end instance adapter related to the back-end
  2706. *
  2707. * @return mixed
  2708. */
  2709. public function getFrontend(){
  2710. }
  2711. public function __destruct(){
  2712. }
  2713. }
  2714. /**
  2715. * Phalcon_Cache_Frontend_Data
  2716. *
  2717. * Allows to cache native PHP data in a serialized form
  2718. *
  2719. */
  2720. class Phalcon_Cache_Frontend_Data
  2721. {
  2722. /**
  2723. * Phalcon_Cache_Frontend_Data constructor
  2724. *
  2725. * @param array $frontendOptions
  2726. */
  2727. public function __construct($frontendOptions){
  2728. }
  2729. /**
  2730. * Returns cache lifetime
  2731. *
  2732. * @return integer
  2733. */
  2734. public function getLifetime(){
  2735. }
  2736. /**
  2737. * Check whether if frontend is buffering output
  2738. */
  2739. public function isBuffering(){
  2740. }
  2741. /**
  2742. * Starts output frontend. Actually, does nothing
  2743. */
  2744. public function start(){
  2745. }
  2746. /**
  2747. * Returns output cached content
  2748. *
  2749. * @return string
  2750. */
  2751. public function getContent(){
  2752. }
  2753. /**
  2754. * Stops output frontend
  2755. */
  2756. public function stop(){
  2757. }
  2758. /**
  2759. * Serializes data before storing it
  2760. */
  2761. public function beforeStore($data){
  2762. }
  2763. /**
  2764. * Unserializes data after retrieving it
  2765. */
  2766. public function afterRetrieve($data){
  2767. }
  2768. }
  2769. /**
  2770. * Phalcon_Cache_Frontend_None
  2771. *
  2772. * Discards any kind of frontend data input. This frontend does not have expiration time or any other options
  2773. *
  2774. */
  2775. class Phalcon_Cache_Frontend_None
  2776. {
  2777. /**
  2778. * Phalcon_Cache_Frontend_None constructor
  2779. */
  2780. public function __construct($frontendOptions){
  2781. }
  2782. /**
  2783. * Returns cache lifetime, always one second expiring content
  2784. */
  2785. public function getLifetime(){
  2786. }
  2787. /**
  2788. * Check whether if frontend is buffering output, always false
  2789. */
  2790. public function isBuffering(){
  2791. }
  2792. /**
  2793. * Starts output frontend
  2794. */
  2795. public function start(){
  2796. }
  2797. /**
  2798. * Returns output cached content
  2799. *
  2800. * @return string
  2801. */
  2802. public function getContent(){
  2803. }
  2804. /**
  2805. * Stops output frontend
  2806. */
  2807. public function stop(){
  2808. }
  2809. public function beforeStore($data){
  2810. }
  2811. /**
  2812. * Prepares data to be retrieved to user
  2813. */
  2814. public function afterRetrieve($data){
  2815. }
  2816. }
  2817. /**
  2818. * Phalcon_Cache_Frontend_Output
  2819. *
  2820. * Allows to cache output fragments captured with ob_* functions
  2821. *
  2822. */
  2823. class Phalcon_Cache_Frontend_Output
  2824. {
  2825. /**
  2826. * Phalcon_Cache_Frontend_Output constructor
  2827. *
  2828. * @param array $frontendOptions
  2829. */
  2830. public function __construct($frontendOptions){
  2831. }
  2832. /**
  2833. * Returns cache lifetime
  2834. *
  2835. * @return integer
  2836. */
  2837. public function getLifetime(){
  2838. }
  2839. /**
  2840. * Check whether if frontend is buffering output
  2841. */
  2842. public function isBuffering(){
  2843. }
  2844. /**
  2845. * Starts output frontend
  2846. */
  2847. public function start(){
  2848. }
  2849. /**
  2850. * Returns output cached content
  2851. *
  2852. * @return string
  2853. */
  2854. public function getContent(){
  2855. }
  2856. /**
  2857. * Stops output frontend
  2858. */
  2859. public function stop(){
  2860. }
  2861. public function beforeStore($data){
  2862. }
  2863. /**
  2864. * Prepares data to be retrieved to user
  2865. */
  2866. public function afterRetrieve($data){
  2867. }
  2868. }
  2869. /**
  2870. * Phalcon_Config_Exception
  2871. *
  2872. * Exceptions thrown in Phalcon_Config will use this class
  2873. *
  2874. */
  2875. class Phalcon_Config_Exception extends Php_Exception
  2876. {
  2877. final private function __clone(){
  2878. }
  2879. public function __construct($message, $code, $previous){
  2880. }
  2881. final public function getMessage(){
  2882. }
  2883. final public function getCode(){
  2884. }
  2885. final public function getFile(){
  2886. }
  2887. final public function getLine(){
  2888. }
  2889. final public function getTrace(){
  2890. }
  2891. final public function getPrevious(){
  2892. }
  2893. final public function getTraceAsString(){
  2894. }
  2895. public function __toString(){
  2896. }
  2897. }
  2898. /**
  2899. * Phalcon_Config_Adapter_Ini
  2900. *
  2901. * Reads ini files and convert it to Phalcon_Config objects.
  2902. *
  2903. * Given the next configuration file:
  2904. *
  2905. * <code> [database]
  2906. *adapter = Mysql
  2907. *host = localhost
  2908. *username = scott
  2909. *password = cheetah
  2910. *name = test_db
  2911. *
  2912. *[phalcon]
  2913. *controllersDir = "../app/controllers/"
  2914. *modelsDir = "../app/models/"
  2915. *viewsDir = "../app/views/"
  2916. *</code>
  2917. *
  2918. * You can read it as follows:
  2919. *
  2920. * <code>
  2921. * $config = new Phalcon_Config_Adapter_Ini("path/config.ini")
  2922. *
  2923. * echo $config->phalcon->controllersDir;
  2924. * echo $config->database->username;
  2925. * </code>
  2926. *
  2927. */
  2928. class Phalcon_Config_Adapter_Ini extends Php_Config
  2929. {
  2930. /**
  2931. * Phalcon_Config_Adapter_Ini constructor
  2932. *
  2933. * @param string $filePath
  2934. * @return Phalcon_Config_Adapter_Ini
  2935. *
  2936. */
  2937. public function __construct($filePath){
  2938. }
  2939. }
  2940. /**
  2941. * Phalcon_Controller_Front
  2942. *
  2943. * Phalcon_Controller_Front implements a "Front Controller" pattern used in "Model-View-Controller" (MVC) applications.
  2944. * Its purpose is to initialize the request environment, route the incoming request, and then dispatch
  2945. * any discovered actions; it aggregates any responses and returns them when the process is complete
  2946. *
  2947. *<code>try {
  2948. *
  2949. * $front = Phalcon_Controller_Front::getInstance();
  2950. *
  2951. * //Setting directories
  2952. * $front->setControllersDir("../app/controllers/");
  2953. * $front->setModelsDir("../app/models/");
  2954. * $front->setViewsDir("../app/views/");
  2955. *
  2956. * //Get response
  2957. * $response = $front->dispatchLoop();
  2958. *
  2959. * echo $response->send();
  2960. *
  2961. * }
  2962. * catch(Phalcon_Exception $e){
  2963. * echo "PhalconException: ", $e->getMessage();
  2964. * }
  2965. *</code>
  2966. */
  2967. class Phalcon_Controller_Front
  2968. {
  2969. /**
  2970. * Private Phalcon_Controller_Front constructor for singleton
  2971. */
  2972. private function __construct(){
  2973. }
  2974. /**
  2975. * Gets Phalcon_Controller_Front singleton instance
  2976. *
  2977. * @return Phalcon_Controller_Front
  2978. */
  2979. public static function getInstance(){
  2980. }
  2981. /**
  2982. * Modifies multipe general settings using a Phalcon_Config object or a stdClass filled with parameters
  2983. *
  2984. * <code>$config = new Phalcon_Config(array(
  2985. * "database" => array(
  2986. * "adapter" => "Mysql",
  2987. * "host" => "localhost",
  2988. * "username" => "scott",
  2989. * "password" => "cheetah",
  2990. * "name" => "test_db"
  2991. * ),
  2992. * "phalcon" => array(
  2993. * "controllersDir" => "../app/controllers/",
  2994. * "modelsDir" => "../app/models/",
  2995. * "viewsDir" => "../app/views/"
  2996. * )
  2997. * ));
  2998. * $front->setConfig($config);</code>
  2999. *
  3000. * @param stdClass $config
  3001. */
  3002. public function setConfig($config){
  3003. }
  3004. /**
  3005. * Sets the database default settings
  3006. *
  3007. * @param stdClass $database
  3008. */
  3009. public function setDatabaseConfig($database){
  3010. }
  3011. /**
  3012. * Sets controllers directory. Depending of your platform, always add a trailing slash or backslash
  3013. *
  3014. * <code> $front->setControllersDir("../app/controllers/"); </code>
  3015. *
  3016. * @param string $controllersDir
  3017. */
  3018. public function setControllersDir($controllersDir){
  3019. }
  3020. /**
  3021. * Sets models directory. Depending of your platform, always add a trailing slash or backslash
  3022. *
  3023. * <code> $front->setModelsDir("../app/models/"); </code>
  3024. *
  3025. * @param string $modelsDir
  3026. */
  3027. public function setModelsDir($modelsDir){
  3028. }
  3029. /**
  3030. * Sets views directory. Depending of your platform, always add a trailing slash or backslash
  3031. *
  3032. * <code> $front->setViewsDir("../app/views/"); </code>
  3033. *
  3034. * @param string $viewsDir
  3035. */
  3036. public function setViewsDir($viewsDir){
  3037. }
  3038. /**
  3039. * Replaces the default router with a predefined object
  3040. *
  3041. * <code> $router = new Phalcon_Router_Rewrite();
  3042. * $router->handle();
  3043. * $front->setRouter($router);</code>
  3044. *
  3045. * @param Phalcon_Router $router
  3046. */
  3047. public function setRouter($router){
  3048. }
  3049. /**
  3050. * Return active router
  3051. *
  3052. * @return Phalcon_Router
  3053. */
  3054. public function getRouter(){
  3055. }
  3056. /**
  3057. * Replaces the default dispatcher with a predefined object
  3058. *
  3059. * @param Phalcon_Dispatcher $dispatcher
  3060. */
  3061. public function setDispatcher($dispatcher){
  3062. }
  3063. /**
  3064. * Return active Dispatcher
  3065. *
  3066. * @return Phalcon_Dispatcher
  3067. */
  3068. public function getDispatcher(){
  3069. }
  3070. /**
  3071. * Sets external uri which app is executed
  3072. *
  3073. * @param string $baseUri
  3074. */
  3075. public function setBaseUri($baseUri){
  3076. }
  3077. /**
  3078. * Gets external uri where app is executed
  3079. *
  3080. * @return string
  3081. */
  3082. public function getBaseUri(){
  3083. }
  3084. /**
  3085. * Sets local path where app/ directory is located. Depending of your platform, always add a trailing slash or backslash
  3086. *
  3087. * @param string $basePath
  3088. */
  3089. public function setBasePath($basePath){
  3090. }
  3091. /**
  3092. * Gets local path where app/ directory is located
  3093. *
  3094. * @return string
  3095. */
  3096. public function getBasePath(){
  3097. }
  3098. /**
  3099. * Overwrites request object default object
  3100. *
  3101. * @param Phalcon_Request $response
  3102. */
  3103. public function setRequest($request){
  3104. }
  3105. /**
  3106. * Overwrites response object default object
  3107. *
  3108. * @param Phalcon_Response $response
  3109. */
  3110. public function setResponse($response){
  3111. }
  3112. /**
  3113. * Overwrites models manager default object
  3114. *
  3115. * @param Phalcon_Model_Manager $model
  3116. */
  3117. public function setModelComponent($model){
  3118. }
  3119. /**
  3120. * Gets the models manager
  3121. *
  3122. * @return Phalcon_Model_Manager
  3123. */
  3124. public function getModelComponent(){
  3125. }
  3126. /**
  3127. * Sets view component
  3128. *
  3129. * @param Phalcon_View $view
  3130. */
  3131. public function setViewComponent($view){
  3132. }
  3133. /**
  3134. * Gets the views part manager
  3135. *
  3136. * @return Phalcon_View
  3137. */
  3138. public function getViewComponent(){
  3139. }
  3140. /**
  3141. * Executes the dispatch loop
  3142. *
  3143. * @return Phalcon_View
  3144. */
  3145. public function dispatchLoop(){
  3146. }
  3147. }
  3148. /**
  3149. * Phalcon_Db_Column
  3150. *
  3151. * Allows to define columns to be used on create or alter table operations
  3152. *
  3153. *<code>
  3154. *new Phalcon_Db_Column("id", array(
  3155. * "type" => Phalcon_Db_Column::TYPE_INTEGER,
  3156. * "size" => 10,
  3157. * "unsigned" => true,
  3158. * "notNull" => true,
  3159. * "autoIncrement" => true,
  3160. * "first" => true
  3161. *)),
  3162. *</code>
  3163. *
  3164. */
  3165. class Phalcon_Db_Column
  3166. {
  3167. const TYPE_INTEGER = 0;
  3168. const TYPE_DATE = 1;
  3169. const TYPE_VARCHAR = 2;
  3170. const TYPE_DECIMAL = 3;
  3171. const TYPE_DATETIME = 4;
  3172. const TYPE_CHAR = 5;
  3173. const TYPE_TEXT = 6;
  3174. /**
  3175. * Phalcon_Db_Column constructor
  3176. *
  3177. * @param string $columnName
  3178. * @param array $definition
  3179. */
  3180. public function __construct($columnName, $definition){
  3181. }
  3182. /**
  3183. * Returns schema's table related to column
  3184. *
  3185. * @return string
  3186. */
  3187. public function getSchemaName(){
  3188. }
  3189. /**
  3190. * Returns column name
  3191. *
  3192. * @return string
  3193. */
  3194. public function getName(){
  3195. }
  3196. /**
  3197. * Returns column type
  3198. *
  3199. * @return int
  3200. */
  3201. public function getType(){
  3202. }
  3203. /**
  3204. * Returns column size
  3205. *
  3206. * @return int
  3207. */
  3208. public function getSize(){
  3209. }
  3210. /**
  3211. * Returns column scale
  3212. *
  3213. * @return int
  3214. */
  3215. public function getScale(){
  3216. }
  3217. /**
  3218. * Returns true if number column is unsigned
  3219. *
  3220. * @return boolean
  3221. */
  3222. public function isUnsigned(){
  3223. }
  3224. /**
  3225. * Not null
  3226. *
  3227. * @return boolean
  3228. */
  3229. public function isNotNull(){
  3230. }
  3231. /**
  3232. * Auto-Increment
  3233. *
  3234. * @return boolean
  3235. */
  3236. public function isAutoIncrement(){
  3237. }
  3238. /**
  3239. * Check whether column have first position in table
  3240. *
  3241. * @return boolean
  3242. */
  3243. public function isFirst(){
  3244. }
  3245. /**
  3246. * Check whether field absolute to position in table
  3247. *
  3248. * @return string
  3249. */
  3250. public function getAfterPosition(){
  3251. }
  3252. }
  3253. /**
  3254. * Phalcon_Db_Exception
  3255. *
  3256. * Exceptions thrown in Phalcon_Db will use this class
  3257. *
  3258. */
  3259. class Phalcon_Db_Exception extends Php_Exception
  3260. {
  3261. final private function __clone(){
  3262. }
  3263. public function __construct($message, $code, $previous){
  3264. }
  3265. final public function getMessage(){
  3266. }
  3267. final public function getCode(){
  3268. }
  3269. final public function getFile(){
  3270. }
  3271. final public function getLine(){
  3272. }
  3273. final public function getTrace(){
  3274. }
  3275. final public function getPrevious(){
  3276. }
  3277. final public function getTraceAsString(){
  3278. }
  3279. public function __toString(){
  3280. }
  3281. }
  3282. /**
  3283. * Phalcon_Db_Index
  3284. *
  3285. * Allows to define indexes to be used on tables
  3286. *
  3287. */
  3288. class Phalcon_Db_Index
  3289. {
  3290. /**
  3291. * Phalcon_Db_Index constructor
  3292. *
  3293. * @param string $indexName
  3294. * @param array $columns
  3295. */
  3296. public function __construct($indexName, $columns){
  3297. }
  3298. /**
  3299. * Gets the index name
  3300. *
  3301. * @return string
  3302. */
  3303. public function getName(){
  3304. }
  3305. /**
  3306. * Gets the columns that comprends the index
  3307. *
  3308. * @return array
  3309. */
  3310. public function getColumns(){
  3311. }
  3312. /**
  3313. * Restore a Phalcon_Db_Index object from export
  3314. *
  3315. * @param array $data
  3316. * @return Phalcon_Db_Index
  3317. */
  3318. public static function __set_state($data){
  3319. }
  3320. }
  3321. /**
  3322. * Phalcon_Db_Pool
  3323. *
  3324. * Manages caching of database connections. With the help of Phalcon_Db_Pool, developers can be sure that no new database
  3325. * connections will made when calling multiple of times Phalcon_Db_Pool::getConnection.
  3326. */
  3327. class Phalcon_Db_Pool
  3328. {
  3329. /**
  3330. * Check if a default descriptor has already defined
  3331. *
  3332. * @return boolean
  3333. */
  3334. public static function hasDefaultDescriptor(){
  3335. }
  3336. /**
  3337. * Sets the default descriptor for database connections.
  3338. *
  3339. *<code>$config = array(
  3340. * "adapter" => "Mysql",
  3341. * "host" => "localhost",
  3342. * "username" => "scott",
  3343. * "password" => "cheetah",
  3344. * "name" => "test_db"
  3345. *);
  3346. *
  3347. *Phalcon_Db_Pool::setDefaultDescriptor($config);</code>
  3348. *
  3349. * @param array $options
  3350. * @return boolean
  3351. */
  3352. public static function setDefaultDescriptor($options){
  3353. }
  3354. /**
  3355. * Returns a connection builded with the default descriptor parameters
  3356. *
  3357. * <code>$connection = Phalcon_Db_Pool::getConnection();</code>
  3358. *
  3359. * @param boolean $newConnection
  3360. * @param boolean $renovate
  3361. * @return Phalcon_Db
  3362. */
  3363. public static function getConnection($newConnection=false, $renovate=false){
  3364. }
  3365. }
  3366. /**
  3367. * Phalcon_Db_Profiler
  3368. *
  3369. * Instances of Phalcon_Db can generate execution profiles
  3370. * on SQL statements sent to the relational database. Profiled
  3371. * information includes execution time in miliseconds.
  3372. * This helps you to identify bottlenecks in your applications.
  3373. *
  3374. */
  3375. class Phalcon_Db_Profiler
  3376. {
  3377. /**
  3378. * Starts the profile of a SQL sentence
  3379. *
  3380. * @param string $sqlStatement
  3381. */
  3382. public function startProfile($sqlStatement){
  3383. }
  3384. /**
  3385. * Stops the active profile
  3386. *
  3387. * @access public
  3388. */
  3389. public function stopProfile(){
  3390. }
  3391. /**
  3392. * Returns the total number of SQL statements processed
  3393. *
  3394. * @return integer
  3395. */
  3396. public function getNumberTotalStatements(){
  3397. }
  3398. /**
  3399. * Returns the total time in seconds spent by the profiles
  3400. *
  3401. * @return double
  3402. */
  3403. public function getTotalElapsedSeconds(){
  3404. }
  3405. /**
  3406. * Returns all the processed profiles
  3407. *
  3408. * @return array
  3409. */
  3410. public function getProfiles(){
  3411. }
  3412. /**
  3413. * Resets the profiler, cleaning up all the profiles
  3414. *
  3415. */
  3416. public function reset(){
  3417. }
  3418. /**
  3419. * Returns the last profile executed in the profiler
  3420. *
  3421. * @return Phalcon_Db_Profiler_Item
  3422. */
  3423. public function getLastProfile(){
  3424. }
  3425. }
  3426. /**
  3427. * Phalcon_Db_RawValue
  3428. *
  3429. * This class lets to insert/update raw data without quoting or formating.
  3430. *
  3431. *<example>
  3432. * The next example shows how to use the MySQL now() function as a field value.
  3433. * <code>
  3434. *$subscriber = new Subscribers();
  3435. *$subscriber->email = 'andres@phalconphp.com';
  3436. *$subscriber->created_at = new Phalcon_Db_RawValue('now()');
  3437. *$subscriber->save();
  3438. * </code>
  3439. * </example>
  3440. */
  3441. class Phalcon_Db_RawValue
  3442. {
  3443. /**
  3444. * Phalcon_Db_RawValue constructor
  3445. *
  3446. * @param string $value
  3447. */
  3448. public function __construct($value){
  3449. }
  3450. /**
  3451. * Returns internal raw value without quoting or formating
  3452. *
  3453. * @return string
  3454. */
  3455. public function getValue(){
  3456. }
  3457. /**
  3458. * Magic method __toString returns raw value without quoting or formating
  3459. */
  3460. public function __toString(){
  3461. }
  3462. }
  3463. /**
  3464. * Phalcon_Db_Reference
  3465. *
  3466. * Allows to define reference constraints on tables
  3467. *
  3468. *<code>
  3469. *$reference = new Phalcon_Db_Reference("field_fk", array(
  3470. * 'referencedSchema' => "invoicing",
  3471. * 'referencedTable' => "products",
  3472. * 'columns' => array("product_type", "product_code"),
  3473. * 'referencedColumns' => array("type", "code")
  3474. *));
  3475. *</code>
  3476. */
  3477. class Phalcon_Db_Reference
  3478. {
  3479. /**
  3480. * Phalcon_Db_Reference constructor
  3481. *
  3482. * @param string $indexName
  3483. * @param array $columns
  3484. */
  3485. public function __construct($referenceName, $definition){
  3486. }
  3487. /**
  3488. * Gets the index name
  3489. *
  3490. * @return string
  3491. */
  3492. public function getName(){
  3493. }
  3494. /**
  3495. * Gets the schema where referenced table is
  3496. *
  3497. * @return string
  3498. */
  3499. public function getSchemaName(){
  3500. }
  3501. /**
  3502. * Gets the schema where referenced table is
  3503. *
  3504. * @return string
  3505. */
  3506. public function getReferencedSchema(){
  3507. }
  3508. /**
  3509. * Gets local columns which reference is based
  3510. *
  3511. * @return array
  3512. */
  3513. public function getColumns(){
  3514. }
  3515. /**
  3516. * Gets the referenced table
  3517. *
  3518. * @return string
  3519. */
  3520. public function getReferencedTable(){
  3521. }
  3522. /**
  3523. * Gets referenced columns
  3524. *
  3525. * @return array
  3526. */
  3527. public function getReferencedColumns(){
  3528. }
  3529. /**
  3530. * Restore a Phalcon_Db_Reference object from export
  3531. *
  3532. * @param array $data
  3533. * @return Phalcon_Db_Reference
  3534. */
  3535. public static function __set_state($data){
  3536. }
  3537. }
  3538. /**
  3539. * Phalcon_Db_Mysql
  3540. *
  3541. * Phalcon_Db_Mysql is the Phalcon_Db adapter for MySQL database.
  3542. * <code>
  3543. *
  3544. * //Setting all posible parameters
  3545. *$config = new stdClass();
  3546. *$config->host = 'localhost';
  3547. *$config->username = 'machine';
  3548. *$config->password = 'sigma';
  3549. *$config->name = 'swarm';
  3550. *$config->charset = 'utf8';
  3551. *$config->collatio = 'utf8_unicode_ci';
  3552. *$config->compression = true;
  3553. *
  3554. * $connection = Phalcon_Db::factory('Mysql', $config);
  3555. *
  3556. * </code>
  3557. */
  3558. class Phalcon_Db_Adapter_Mysql extends Php_Db
  3559. {
  3560. const DB_ASSOC = 1;
  3561. const DB_BOTH = 2;
  3562. const DB_NUM = 3;
  3563. /**
  3564. * Constructor for Phalcon_Db_Adapter_Mysql. This method does not should to be called directly. Use Phalcon_Db::factory instead
  3565. *
  3566. * @param stdClass $descriptor
  3567. * @param boolean $persistent
  3568. */
  3569. public function __construct($descriptor=NULL){
  3570. }
  3571. /**
  3572. * This method is automatically called in Phalcon_Db_Mysql constructor.
  3573. * Call it when you need to restore a database connection
  3574. *
  3575. * @param stdClass $descriptor
  3576. * @param boolean $persistent
  3577. * @return boolean
  3578. */
  3579. public function connect($descriptor=NULL){
  3580. }
  3581. /**
  3582. * Sends SQL statements to the MySQL database server returning success state.
  3583. * When the SQL sent have returned any row, the result is a PHP resource.
  3584. *
  3585. * <code>
  3586. * //Inserting data
  3587. * $success = $connection->query("INSERT INTO robots VALUES (1, 'Astro Boy')");
  3588. *
  3589. * //Querying data
  3590. * $resultset = $connection->query("SELECT * FROM robots");</code>
  3591. *
  3592. * @param string $sqlStatement
  3593. * @return boolean
  3594. */
  3595. public function query($sqlStatement){
  3596. }
  3597. /**
  3598. * Closes active connection returning success. Phalcon automatically closes and destroys active connections within Phalcon_Db_Pool
  3599. *
  3600. * @return boolean
  3601. */
  3602. public function close(){
  3603. }
  3604. /**
  3605. * Returns an array of strings that corresponds to the fetched row, or FALSE if there are no more rows.
  3606. * This method is affected by the active fetch flag set using Phalcon_Db_Mysql::setFetchMode
  3607. *
  3608. * <code>
  3609. *$connection->setFetchMode(Phalcon_Db::DB_NUM);
  3610. *$result = $connection->query("SELECT * FROM robots ORDER BY name");
  3611. *while($robot = $connection->fetchArray($result)){
  3612. * print_r($robot);
  3613. *}
  3614. * </code>
  3615. *
  3616. * @param resource $resultQuery
  3617. * @return boolean
  3618. */
  3619. public function fetchArray($resultQuery=NULL){
  3620. }
  3621. /**
  3622. * Gets number of rows returned by a resulset
  3623. *
  3624. * <code>
  3625. *$result = $connection->query("SELECT * FROM robots ORDER BY name");
  3626. *echo 'There are ', $connection->numRows($result), ' in resulset';
  3627. * </code>
  3628. *
  3629. * @param resource $resultQuery
  3630. * @return int
  3631. */
  3632. public function numRows($resultQuery=NULL){
  3633. }
  3634. /**
  3635. * Moves internal resulset cursor to another position letting us to fetch a certain row
  3636. *
  3637. * <code>
  3638. *$result = $connection->query("SELECT * FROM robots ORDER BY name");
  3639. *$connection->dataSeek(2, $result); // Move to third row on result
  3640. * $row = $connection->fetchArray($result); // Fetch third row
  3641. * </code>
  3642. *
  3643. * @param resource $resultQuery
  3644. * @return int
  3645. */
  3646. public function dataSeek($number, $resultQuery=NULL){
  3647. }
  3648. /**
  3649. * Returns number of affected rows by the last INSERT/UPDATE/DELETE repoted by MySQL
  3650. *
  3651. * <code>
  3652. *$connection->query("DELETE FROM robots");
  3653. *echo $connection->affectedRows(), ' affected rows';
  3654. * </code>
  3655. *
  3656. * @param resource $resultQuery
  3657. * @return int
  3658. */
  3659. public function affectedRows($resultQuery=NULL){
  3660. }
  3661. /**
  3662. * Changes the fetching mode affecting Phalcon_Db_Mysql::fetchArray
  3663. *
  3664. * <code>
  3665. * //Return array with integer indexes
  3666. * $connection->setFetchMode(Phalcon_Db::DB_NUM);
  3667. *
  3668. * //Return associative array without integer indexes
  3669. * $connection->setFetchMode(Phalcon_Db::DB_ASSOC);
  3670. *
  3671. * //Return associative array together with integer indexes
  3672. * $connection->setFetchMode(Phalcon_Db::DB_BOTH);
  3673. * </code>
  3674. *
  3675. * @param int $fetchMode
  3676. */
  3677. public function setFetchMode($fetchMode){
  3678. }
  3679. /**
  3680. * Returns last error message from MySQL
  3681. *
  3682. * @param string $errorString
  3683. * @param resurce $resultQuery
  3684. * @return string
  3685. */
  3686. public function error($errorString=NULL, $resultQuery=NULL){
  3687. }
  3688. /**
  3689. * Returns last error code from MySQL
  3690. *
  3691. * @param string $errorString
  3692. * @param resurce $resultQuery
  3693. * @return string
  3694. */
  3695. public function noError($resultQuery=NULL){
  3696. }
  3697. /**
  3698. * Returns insert id for the auto_increment column inserted in the last SQL statement
  3699. *
  3700. * @param string $table
  3701. * @param string $primaryKey
  3702. * @param string $sequenceName
  3703. * @return int
  3704. */
  3705. public function lastInsertId($table=NULL, $primaryKey=NULL, $sequenceName=NULL){
  3706. }
  3707. /**
  3708. * Gets a list of columns
  3709. *
  3710. * @param array $columnList
  3711. * @return string
  3712. */
  3713. public function getColumnList($columnList){
  3714. }
  3715. /**
  3716. * Appends a LIMIT clause to $sqlQuery argument
  3717. *
  3718. * <code>$connection->limit("SELECT * FROM robots", 5);</code>
  3719. *
  3720. * @param string $errorString
  3721. * @param int $number
  3722. * @return string
  3723. */
  3724. public function limit($sqlQuery, $number){
  3725. }
  3726. /**
  3727. * Generates SQL checking for the existence of a schema.table
  3728. *
  3729. * <code>$connection->tableExists("blog", "posts")</code>
  3730. *
  3731. * @param string $tableName
  3732. * @param string $schemaName
  3733. * @return string
  3734. */
  3735. public function tableExists($tableName, $schemaName=NULL){
  3736. }
  3737. /**
  3738. * Generates SQL checking for the existence of a schema.view
  3739. *
  3740. * <code>$connection->viewExists("active_users", "posts")</code>
  3741. *
  3742. * @param string $tableName
  3743. * @param string $schemaName
  3744. * @return string
  3745. */
  3746. public function viewExists($viewName, $schemaName=NULL){
  3747. }
  3748. /**
  3749. * Devuelve un FOR UPDATE valido para un SELECT del RBDM
  3750. *
  3751. * @param string $sqlQuery
  3752. * @return string
  3753. */
  3754. public function forUpdate($sqlQuery){
  3755. }
  3756. /**
  3757. * Devuelve un SHARED LOCK valido para un SELECT del RBDM
  3758. *
  3759. * @param string $sqlQuery
  3760. * @return string
  3761. */
  3762. public function sharedLock($sqlQuery){
  3763. }
  3764. /**
  3765. * Creates a table using MySQL SQL
  3766. *
  3767. * @param string $tableName
  3768. * @param string $schemaName
  3769. * @param array $definition
  3770. * @return boolean
  3771. */
  3772. public function createTable($tableName, $schemaName, $definition){
  3773. }
  3774. /**
  3775. * Drops a table from a schema/database
  3776. *
  3777. * @param string $tableName
  3778. * @param string $schemaName
  3779. * @param boolean $ifExists
  3780. * @return boolean
  3781. */
  3782. public function dropTable($tableName, $schemaName, $ifExists=true){
  3783. }
  3784. /**
  3785. * Adds a column to a table
  3786. *
  3787. * @param string $tableName
  3788. * @param string $schemaName
  3789. * @param Phalcon_Db_Column $column
  3790. * @return boolean
  3791. */
  3792. public function addColumn($tableName, $schemaName, $column){
  3793. }
  3794. /**
  3795. * Modifies a table column based on a definition
  3796. *
  3797. * @param string $tableName
  3798. * @param string $schemaName
  3799. * @param Phalcon_Db_Column $column
  3800. * @return boolean
  3801. */
  3802. public function modifyColumn($tableName, $schemaName, $column){
  3803. }
  3804. /**
  3805. * Drops a column from a table
  3806. *
  3807. * @param string $tableName
  3808. * @param string $schemaName
  3809. * @param string $columnName
  3810. * @return boolean
  3811. */
  3812. public function dropColumn($tableName, $schemaName, $columnName){
  3813. }
  3814. /**
  3815. * Adds an index to a table
  3816. *
  3817. * @param string $tableName
  3818. * @param string $schemaName
  3819. * @param DbIndex $index
  3820. * @return boolean
  3821. */
  3822. public function addIndex($tableName, $schemaName, $index){
  3823. }
  3824. /**
  3825. * Drop an index from a table
  3826. *
  3827. * @param string $tableName
  3828. * @param string $schemaName
  3829. * @param string $indexName
  3830. * @return boolean
  3831. */
  3832. public function dropIndex($tableName, $schemaName, $indexName){
  3833. }
  3834. /**
  3835. * Adds a primary key to a table
  3836. *
  3837. * @param string $tableName
  3838. * @param string $schemaName
  3839. * @param Phalcon_Db_Index $index
  3840. * @return boolean
  3841. */
  3842. public function addPrimaryKey($tableName, $schemaName, $index){
  3843. }
  3844. /**
  3845. * Drops primary key from a table
  3846. *
  3847. * @param string $tableName
  3848. * @param string $schemaName
  3849. * @return boolean
  3850. */
  3851. public function dropPrimaryKey($tableName, $schemaName){
  3852. }
  3853. /**
  3854. * Adds a foreign key to a table
  3855. *
  3856. * @param string $tableName
  3857. * @param string $schemaName
  3858. * @param Phalcon_Db_Reference $reference
  3859. * @return boolean true
  3860. */
  3861. public function addForeignKey($tableName, $schemaName, $reference){
  3862. }
  3863. /**
  3864. * Drops a foreign key from a table
  3865. *
  3866. * @param string $tableName
  3867. * @param string $schemaName
  3868. * @param string $referenceName
  3869. * @return boolean true
  3870. */
  3871. public function dropForeignKey($tableName, $schemaName, $referenceName){
  3872. }
  3873. /**
  3874. * Returns the SQL column definition from a column
  3875. *
  3876. * @param Phalcon_Db_Column $column
  3877. * @return string
  3878. */
  3879. public function getColumnDefinition($column){
  3880. }
  3881. /**
  3882. * Generates SQL describing a table
  3883. *
  3884. * <code>print_r($connection->describeTable("posts") ?></code>
  3885. *
  3886. * @param string $tableName
  3887. * @param string $schemaName
  3888. * @return string
  3889. */
  3890. public function describeTable($table, $schema=NULL){
  3891. }
  3892. /**
  3893. * List all tables on a database
  3894. *
  3895. * <code> print_r($connection->listTables("blog") ?></code>
  3896. *
  3897. * @param string $schemaName
  3898. * @return array
  3899. */
  3900. public function listTables($schemaName=NULL){
  3901. }
  3902. /**
  3903. * Returns a database date formatted
  3904. *
  3905. * <code>$format = $connection->getDateUsingFormat("2011-02-01", "YYYY-MM-DD");</code>
  3906. *
  3907. * @param string $date
  3908. * @param string $format
  3909. * @return string
  3910. */
  3911. public function getDateUsingFormat($date, $format='YYYY-MM-DD'){
  3912. }
  3913. /**
  3914. * Lists table indexes
  3915. *
  3916. * @param string $table
  3917. * @param string $schema
  3918. * @return array
  3919. */
  3920. public function describeIndexes($table, $schema=NULL){
  3921. }
  3922. /**
  3923. * Lists table references
  3924. *
  3925. * @param string $table
  3926. * @param string $schema
  3927. * @return array
  3928. */
  3929. public function describeReferences($table, $schema=NULL){
  3930. }
  3931. /**
  3932. * Gets creation options from a table
  3933. *
  3934. * @param string $tableName
  3935. * @param string $schemaName
  3936. * @return array
  3937. */
  3938. public function tableOptions($tableName, $schemaName=NULL){
  3939. }
  3940. /**
  3941. * Sets a logger class to log all SQL operations sent to database server
  3942. *
  3943. * @param Phalcon_Logger $logger
  3944. */
  3945. public function setLogger($logger){
  3946. }
  3947. /**
  3948. * Returns the active logger
  3949. *
  3950. * @return Phalcon_Logger
  3951. */
  3952. public function getLogger(){
  3953. }
  3954. /**
  3955. * Sends arbitrary text to a related logger in the instance
  3956. *
  3957. * @param string $sqlStatement
  3958. * @param int $type
  3959. */
  3960. protected function log($sqlStatement, $type){
  3961. }
  3962. /**
  3963. * Sets a database profiler to the connection
  3964. *
  3965. * @param Phalcon_Db_Profiler $profiler
  3966. */
  3967. public function setProfiler($profiler){
  3968. }
  3969. /**
  3970. * Returns the first row in a SQL query result
  3971. *
  3972. * <code>
  3973. * //Getting first robot
  3974. * $robot = $connection->fecthOne("SELECT * FROM robots");
  3975. * print_r($robot);
  3976. * </code>
  3977. *
  3978. * @param string $sqlQuery
  3979. * @return array
  3980. */
  3981. public function fetchOne($sqlQuery){
  3982. }
  3983. /**
  3984. * Dumps the complete result of a query into an array
  3985. *
  3986. * <code>
  3987. * //Getting all robots
  3988. * $robots = $connection->fetchAll("SELECT * FROM robots");
  3989. * foreach($robots as $robot){
  3990. * print_r($robot);
  3991. * }
  3992. * </code>
  3993. *
  3994. * @param string $sqlQuery
  3995. * @return array
  3996. */
  3997. public function fetchAll($sqlQuery){
  3998. }
  3999. /**
  4000. * Inserts data into a table using custom RBDM SQL syntax
  4001. *
  4002. * <code>
  4003. * //Inserting a new robot
  4004. * $success = $connection->insert(
  4005. * "robots",
  4006. * array("Astro Boy", 1952),
  4007. * array("name", "year")
  4008. * );
  4009. *
  4010. * //Next SQL sentence is sent to the database system
  4011. * INSERT INTO `robots` (`name`, `year`) VALUES ("Astro boy", 1952);
  4012. * </code>
  4013. *
  4014. * @param string $tables
  4015. * @param array $values
  4016. * @param array $fields
  4017. * @param boolean $automaticQuotes
  4018. * @return boolean
  4019. */
  4020. public function insert($table, $values, $fields=NULL, $automaticQuotes=false){
  4021. }
  4022. /**
  4023. * Updates data on a table using custom RBDM SQL syntax
  4024. *
  4025. * <code>
  4026. * //Updating existing robot
  4027. * $success = $connection->update(
  4028. * "robots",
  4029. * array("name")
  4030. * array("New Astro Boy"),
  4031. * "id = 101"
  4032. * );
  4033. *
  4034. * //Next SQL sentence is sent to the database system
  4035. * UPDATE `robots` SET `name` = "Astro boy" WHERE id = 101
  4036. * </code>
  4037. *
  4038. * @param string $tables
  4039. * @param array $fields
  4040. * @param array $values
  4041. * @param string $whereCondition
  4042. * @param boolean $automaticQuotes
  4043. * @return boolean
  4044. */
  4045. public function update($table, $fields, $values, $whereCondition=NULL, $automaticQuotes=false){
  4046. }
  4047. /**
  4048. * Deletes data from a table using custom RBDM SQL syntax
  4049. *
  4050. * <code>
  4051. * //Deleting existing robot
  4052. * $success = $connection->delete(
  4053. * "robots",
  4054. * "id = 101"
  4055. * );
  4056. *
  4057. * //Next SQL sentence is generated
  4058. * DELETE FROM `robots` WHERE id = 101
  4059. * </code>
  4060. *
  4061. * @param string $tables
  4062. * @param string $whereCondition
  4063. * @return boolean
  4064. */
  4065. public function delete($table, $whereCondition=''){
  4066. }
  4067. /**
  4068. * Starts a transaction in the connection
  4069. *
  4070. * @return boolean
  4071. */
  4072. public function begin(){
  4073. }
  4074. /**
  4075. * Rollbacks the active transaction in the connection
  4076. *
  4077. * @return boolean
  4078. */
  4079. public function rollback(){
  4080. }
  4081. /**
  4082. * Commits the active transaction in the connection
  4083. *
  4084. * @return boolean
  4085. */
  4086. public function commit(){
  4087. }
  4088. /**
  4089. * Manually sets a "under transaction" state for the connection
  4090. *
  4091. * @param boolean $underTransaction
  4092. */
  4093. protected function setUnderTransaction($underTransaction){
  4094. }
  4095. /**
  4096. * Checks whether connection is under database transaction
  4097. *
  4098. * @return boolean
  4099. */
  4100. public function isUnderTransaction(){
  4101. }
  4102. /**
  4103. * Checks whether connection have auto commit
  4104. *
  4105. * @return boolean
  4106. */
  4107. public function getHaveAutoCommit(){
  4108. }
  4109. /**
  4110. * Returns database name in the internal connection
  4111. *
  4112. * @return string
  4113. */
  4114. public function getDatabaseName(){
  4115. }
  4116. /**
  4117. * Returns active schema name in the internal connection
  4118. *
  4119. * @return string
  4120. */
  4121. public function getDefaultSchema(){
  4122. }
  4123. /**
  4124. * Returns the username which has connected to the database
  4125. *
  4126. * @return string
  4127. */
  4128. public function getUsername(){
  4129. }
  4130. /**
  4131. * Returns the username which has connected to the database
  4132. *
  4133. * @return string
  4134. */
  4135. public function getHostName(){
  4136. }
  4137. /**
  4138. * Gets an active connection unique identifier
  4139. *
  4140. * @return string
  4141. */
  4142. public function getConnectionId($asString=false){
  4143. }
  4144. /**
  4145. * This method is executed before every SQL statement sent to the database system
  4146. *
  4147. * @param string $sqlStatement
  4148. */
  4149. protected function _beforeQuery($sqlStatement){
  4150. }
  4151. /**
  4152. * This method is executed after every SQL statement sent to the database system
  4153. *
  4154. * @param string $sqlStatement
  4155. */
  4156. protected function _afterQuery($sqlStatement){
  4157. }
  4158. /**
  4159. * Instantiates Phalcon_Db adapter using given parameters
  4160. *
  4161. * @param string $adapterName
  4162. * @param stdClass $options
  4163. * @return Phalcon_Db
  4164. */
  4165. public static function factory($adapterName, $options){
  4166. }
  4167. }
  4168. /**
  4169. * Phalcon_Db_Dialect_Mysql
  4170. *
  4171. * Generates database specific SQL for the MySQL RBDM
  4172. */
  4173. class Phalcon_Db_Dialect_Mysql
  4174. {
  4175. /**
  4176. * Generates the SQL for a MySQL LIMIT clause
  4177. *
  4178. * @param string $errorString
  4179. * @param int $number
  4180. * @return string
  4181. */
  4182. public static function limit($sqlQuery, $number){
  4183. }
  4184. /**
  4185. * Gets a list of columns
  4186. *
  4187. * @param array $columnList
  4188. * @return string
  4189. */
  4190. public static function getColumnList($columnList){
  4191. }
  4192. /**
  4193. * Gets the column name in MySQL
  4194. *
  4195. * @param Phalcon_Db_Column $column
  4196. */
  4197. public static function getColumnDefinition($column){
  4198. }
  4199. /**
  4200. * Generates SQL to add a column to a table
  4201. *
  4202. * @param string $tableName
  4203. * @param string $schemaName
  4204. * @param Phalcon_Db_Column $column
  4205. * @return string
  4206. */
  4207. public static function addColumn($tableName, $schemaName, $column){
  4208. }
  4209. /**
  4210. * Generates SQL to modify a column in a table
  4211. *
  4212. * @param string $tableName
  4213. * @param string $schemaName
  4214. * @param Phalcon_Db_Column $column
  4215. * @return string
  4216. */
  4217. public static function modifyColumn($tableName, $schemaName, $column){
  4218. }
  4219. /**
  4220. * Generates SQL to delete a column from a table
  4221. *
  4222. * @param string $tableName
  4223. * @param string $schemaName
  4224. * @param string $column
  4225. * @return string
  4226. */
  4227. public static function dropColumn($tableName, $schemaName, $columnName){
  4228. }
  4229. /**
  4230. * Generates SQL to add an index to a table
  4231. *
  4232. * @param string $tableName
  4233. * @param string $schemaName
  4234. * @param Phalcon_Db_Index $index
  4235. * @return string
  4236. */
  4237. public static function addIndex($tableName, $schemaName, $index){
  4238. }
  4239. /**
  4240. * Generates SQL to delete an index from a table
  4241. *
  4242. * @param string $tableName
  4243. * @param string $schemaName
  4244. * @param string $indexName
  4245. * @return string
  4246. */
  4247. public static function dropIndex($tableName, $schemaName, $indexName){
  4248. }
  4249. /**
  4250. * Generates SQL to add the primary key to a table
  4251. *
  4252. * @param string $tableName
  4253. * @param string $schemaName
  4254. * @param Phalcon_Db_Index $index
  4255. * @return string
  4256. */
  4257. public static function addPrimaryKey($tableName, $schemaName, $index){
  4258. }
  4259. /**
  4260. * Generates SQL to delete primary key from a table
  4261. *
  4262. * @param string $tableName
  4263. * @param string $schemaName
  4264. * @return string
  4265. */
  4266. public static function dropPrimaryKey($tableName, $schemaName){
  4267. }
  4268. /**
  4269. * Generates SQL to add an index to a table
  4270. *
  4271. * @param string $tableName
  4272. * @param string $schemaName
  4273. * @param Phalcon_Db_Reference $reference
  4274. * @return string
  4275. */
  4276. public static function addForeignKey($tableName, $schemaName, $reference){
  4277. }
  4278. /**
  4279. * Generates SQL to delete a foreign key from a table
  4280. *
  4281. * @param string $tableName
  4282. * @param string $schemaName
  4283. * @param string $referenceName
  4284. * @return string
  4285. */
  4286. public static function dropForeignKey($tableName, $schemaName, $referenceName){
  4287. }
  4288. protected static function _getTableOptions($definition){
  4289. }
  4290. /**
  4291. * Generates SQL to create a table in MySQL
  4292. *
  4293. * @param string $tableName
  4294. * @param string $schemaName
  4295. * @param array $definition
  4296. * @return string
  4297. */
  4298. public static function createTable($tableName, $schemaName, $definition){
  4299. }
  4300. /**
  4301. * Generates SQL to drop a table
  4302. *
  4303. * @param string $tableName
  4304. * @param string $schemaName
  4305. * @param boolean $ifExists
  4306. * @return boolean
  4307. */
  4308. public function dropTable($tableName, $schemaName, $ifExists=true){
  4309. }
  4310. /**
  4311. * Generates SQL checking for the existence of a schema.table
  4312. *
  4313. * <code>echo Phalcon_Db_Dialect_Mysql::tableExists("posts", "blog")</code>
  4314. * <code>echo Phalcon_Db_Dialect_Mysql::tableExists("posts")</code>
  4315. *
  4316. * @param string $tableName
  4317. * @param string $schemaName
  4318. * @return string
  4319. */
  4320. public static function tableExists($tableName, $schemaName=NULL){
  4321. }
  4322. /**
  4323. * Generates SQL describing a table
  4324. *
  4325. * <code>print_r(Phalcon_Db_Dialect_Mysql::describeTable("posts") ?></code>
  4326. *
  4327. * @param string $tableName
  4328. * @param string $schemaName
  4329. * @return string
  4330. */
  4331. public static function describeTable($table, $schema=NULL){
  4332. }
  4333. /**
  4334. * List all tables on database
  4335. *
  4336. * <code>print_r(Phalcon_Db_Dialect_Mysql::listTables("blog") ?></code>
  4337. *
  4338. * @param string $schemaName
  4339. * @return array
  4340. */
  4341. public static function listTables($schemaName=NULL){
  4342. }
  4343. /**
  4344. * Generates SQL to query indexes on a table
  4345. *
  4346. * @param string $table
  4347. * @param string $schema
  4348. * @return string
  4349. */
  4350. public static function describeIndexes($table, $schema=NULL){
  4351. }
  4352. /**
  4353. * Generates SQL to query foreign keys on a table
  4354. *
  4355. * @param string $table
  4356. * @param string $schema
  4357. * @return string
  4358. */
  4359. public static function describeReferences($table, $schema=NULL){
  4360. }
  4361. /**
  4362. * Generates the SQL to describe the table creation options
  4363. *
  4364. * @param string $table
  4365. * @param string $schema
  4366. * @return string
  4367. */
  4368. public static function tableOptions($table, $schema=NULL){
  4369. }
  4370. }
  4371. /**
  4372. * Phalcon_Db_Profiler_Item
  4373. *
  4374. * This class identifies each profile in a Phalcon_Db_Profiler
  4375. *
  4376. */
  4377. class Phalcon_Db_Profiler_Item
  4378. {
  4379. /**
  4380. * Sets the SQL statement related to the profile
  4381. *
  4382. * @param string $sqlStatement
  4383. */
  4384. public function setSQLStatement($sqlStatement){
  4385. }
  4386. /**
  4387. * Returns the SQL statement related to the profile
  4388. *
  4389. * @return string
  4390. */
  4391. public function getSQLStatement(){
  4392. }
  4393. /**
  4394. * Sets the timestamp on when the profile started
  4395. *
  4396. * @param int $initialTime
  4397. */
  4398. public function setInitialTime($initialTime){
  4399. }
  4400. /**
  4401. * Sets the timestamp on when the profile ended
  4402. *
  4403. * @param int $finalTime
  4404. */
  4405. public function setFinalTime($finalTime){
  4406. }
  4407. /**
  4408. * Returns the initial time in milseconds on when the profile started
  4409. *
  4410. * @return double
  4411. */
  4412. public function getInitialTime(){
  4413. }
  4414. /**
  4415. * Returns the initial time in milseconds on when the profile ended
  4416. *
  4417. * @return double
  4418. */
  4419. public function getFinalTime(){
  4420. }
  4421. /**
  4422. * Returns the total time in seconds spent by the profile
  4423. *
  4424. * @return double
  4425. */
  4426. public function getTotalElapsedSeconds(){
  4427. }
  4428. }
  4429. /**
  4430. * Phalcon_Dispatcher_Exception
  4431. *
  4432. * Exceptions thrown in Phalcon_Dispatcher will use this class
  4433. *
  4434. */
  4435. class Phalcon_Dispatcher_Exception extends Php_Exception
  4436. {
  4437. final private function __clone(){
  4438. }
  4439. public function __construct($message, $code, $previous){
  4440. }
  4441. final public function getMessage(){
  4442. }
  4443. final public function getCode(){
  4444. }
  4445. final public function getFile(){
  4446. }
  4447. final public function getLine(){
  4448. }
  4449. final public function getTrace(){
  4450. }
  4451. final public function getPrevious(){
  4452. }
  4453. final public function getTraceAsString(){
  4454. }
  4455. public function __toString(){
  4456. }
  4457. }
  4458. /**
  4459. * Phalcon_Logger_Exception
  4460. *
  4461. * Exceptions thrown in Phalcon_Logger will use this class
  4462. *
  4463. */
  4464. class Phalcon_Logger_Exception extends Php_Exception
  4465. {
  4466. /**
  4467. * Phalcon_Logger_Exception constructor
  4468. *
  4469. * @param string $message
  4470. */
  4471. public function __construct($message){
  4472. }
  4473. final private function __clone(){
  4474. }
  4475. final public function getMessage(){
  4476. }
  4477. final public function getCode(){
  4478. }
  4479. final public function getFile(){
  4480. }
  4481. final public function getLine(){
  4482. }
  4483. final public function getTrace(){
  4484. }
  4485. final public function getPrevious(){
  4486. }
  4487. final public function getTraceAsString(){
  4488. }
  4489. public function __toString(){
  4490. }
  4491. }
  4492. /**
  4493. * Phalcon_Logger_Item
  4494. *
  4495. * Represents each item in a logger transaction
  4496. *
  4497. */
  4498. class Phalcon_Logger_Item
  4499. {
  4500. /**
  4501. * Phalcon_Logger_Item contructor
  4502. *
  4503. * @param string $message
  4504. * @param integer $type
  4505. * @param integer $time
  4506. */
  4507. public function __construct($message, $type, $time=0){
  4508. }
  4509. /**
  4510. * Returns the message
  4511. *
  4512. * @return string
  4513. */
  4514. public function getMessage(){
  4515. }
  4516. /**
  4517. * Returns the log type
  4518. *
  4519. * @return integer
  4520. */
  4521. public function getType(){
  4522. }
  4523. /**
  4524. * Returns log timestamp
  4525. *
  4526. * @return integer
  4527. */
  4528. public function getTime(){
  4529. }
  4530. }
  4531. /**
  4532. * Phalcon_Logger_Adapter_File
  4533. *
  4534. * Adapter to store logs in plain text files
  4535. *
  4536. */
  4537. class Phalcon_Logger_Adapter_File
  4538. {
  4539. /**
  4540. * Phalcon_Logger_Adapter_File constructor
  4541. *
  4542. * @param string $name
  4543. * @param array $options
  4544. */
  4545. public function __construct($name, $options=array ()){
  4546. }
  4547. /**
  4548. * Set the log format
  4549. *
  4550. * @param string $format
  4551. */
  4552. public function setFormat($format){
  4553. }
  4554. /**
  4555. * Returns the log format
  4556. *
  4557. * @param string $format
  4558. */
  4559. public function getFormat($format){
  4560. }
  4561. /**
  4562. * Returns the string meaning of a logger constant
  4563. *
  4564. * @param integer $type
  4565. * @return string
  4566. */
  4567. public function getTypeString($type){
  4568. }
  4569. /**
  4570. * Applies the internal format to the message
  4571. *
  4572. * @param string $message
  4573. * @return string
  4574. */
  4575. protected function _applyFormat($message, $type, $time=0){
  4576. }
  4577. /**
  4578. * Sets the internal date format
  4579. *
  4580. * @param string $date
  4581. */
  4582. public function setDateFormat($date){
  4583. }
  4584. /**
  4585. * Returns the internal date format
  4586. *
  4587. * @return string
  4588. */
  4589. public function getDateFormat(){
  4590. }
  4591. /**
  4592. * Sends/Writes messages to the file log
  4593. *
  4594. * @param string $message
  4595. * @param int $type
  4596. */
  4597. public function log($message, $type){
  4598. }
  4599. /**
  4600. * Starts a transaccion
  4601. *
  4602. */
  4603. public function begin(){
  4604. }
  4605. /**
  4606. * Commits the internal transaction
  4607. *
  4608. */
  4609. public function commit(){
  4610. }
  4611. /**
  4612. * Rollbacks the internal transaction
  4613. *
  4614. */
  4615. public function rollback(){
  4616. }
  4617. /**
  4618. * Closes the logger
  4619. *
  4620. * @return boolean
  4621. */
  4622. public function close(){
  4623. }
  4624. /**
  4625. * Opens the internal file handler on unserialization
  4626. *
  4627. */
  4628. public function __wakeup(){
  4629. }
  4630. }
  4631. /**
  4632. * Phalcon_Model_Base
  4633. *
  4634. * <p>Phalcon_Model connects business objects and database tables to create
  4635. * a persistable domain model where logic and data are presented in one wrapping.
  4636. * It‘s an implementation of the object- relational mapping (ORM).</p>
  4637. *
  4638. * <p>A model represents the information (data) of the application and the rules to manipulate that data.
  4639. * Models are primarily used for managing the rules of interaction with a corresponding database table.
  4640. * In most cases, each table in your database will correspond to one model in your application.
  4641. * The bulk of your application’s business logic will be concentrated in the models.</p>
  4642. *
  4643. * <p>Phalcon_Model is the first ORM written in C-language for PHP, giving to developers high performance
  4644. * when interact with databases while is also easy to use.</p>
  4645. *
  4646. * <code>
  4647. * $manager = new Phalcon_Model_Manager();
  4648. *$manager->setModelsDir('app/models/');
  4649. *
  4650. *$robot = new Robots();
  4651. *$robot->type = 'mechanical'
  4652. *$robot->name = 'Astro Boy';
  4653. *$robot->year = 1952;
  4654. *if ($robot->save() == false) {
  4655. * echo "Umh, We can store robots: ";
  4656. * foreach ($robot->getMessages() as $message) {
  4657. * echo $message;
  4658. * }
  4659. *} else {
  4660. * echo "Great, a new robot was saved successfully!";
  4661. *}
  4662. * </code>
  4663. *
  4664. */
  4665. abstract class Phalcon_Model_Base
  4666. {
  4667. const OP_CREATE = 1;
  4668. const OP_UPDATE = 2;
  4669. const OP_DELETE = 3;
  4670. /**
  4671. * Phalcon_Model_Base constructor
  4672. *
  4673. * @param Phalcon_Model_Manager $manager
  4674. */
  4675. final public function __construct($manager=NULL){
  4676. }
  4677. /**
  4678. * Overwrites default model manager
  4679. *
  4680. * @param Phalcon_Model_Manager $manager
  4681. */
  4682. public static function setManager($manager){
  4683. }
  4684. /**
  4685. * Returns internal models manager
  4686. *
  4687. * @return Phalcon_Model_Manager
  4688. */
  4689. public static function getManager(){
  4690. }
  4691. /**
  4692. * Internal method to create a connection. Automatically dumps mapped table meta-data
  4693. *
  4694. */
  4695. protected function _connect(){
  4696. }
  4697. /**
  4698. * Return an array with the attributes names
  4699. *
  4700. * @return array
  4701. */
  4702. public function getAttributes(){
  4703. }
  4704. /**
  4705. * Returns an array of attributes that are part of the related table primary key
  4706. *
  4707. * @return array
  4708. */
  4709. public function getPrimaryKeyAttributes(){
  4710. }
  4711. /**
  4712. * Returns an array of attributes that aren't part of the primary key
  4713. *
  4714. * @return array
  4715. */
  4716. public function getNonPrimaryKeyAttributes(){
  4717. }
  4718. /**
  4719. * Returns an array of not-nullable attributes
  4720. *
  4721. * @return array
  4722. */
  4723. public function getNotNullAttributes(){
  4724. }
  4725. /**
  4726. * Returns an array of numeric attributes
  4727. *
  4728. * @return array
  4729. */
  4730. public function getDataTypesNumeric(){
  4731. }
  4732. /**
  4733. * Returns an array of data-types attributes
  4734. *
  4735. * @return array
  4736. */
  4737. public function getDataTypes(){
  4738. }
  4739. /**
  4740. * Returns the name of the identity field
  4741. *
  4742. * @return string
  4743. */
  4744. public function getIdentityField(){
  4745. }
  4746. /**
  4747. * Dumps mapped table meta-data
  4748. *
  4749. * @return Phalcon_Model_Base
  4750. */
  4751. protected function dump(){
  4752. }
  4753. /**
  4754. * Creates SQL statement which returns many rows
  4755. *
  4756. * @param Phalcon_Manager $manager
  4757. * @param Phalcon_Model_Base $model
  4758. * @param Phalcon_Db $connection
  4759. * @param array $params
  4760. * @return array
  4761. */
  4762. protected static function _createSQLSelectMulti($manager, $model, $connection, $params){
  4763. }
  4764. /**
  4765. * Creates SQL statement which returns many rows
  4766. *
  4767. * @param Phalcon_Manager $manager
  4768. * @param Phalcon_Model_Base $model
  4769. * @param Phalcon_Db $connection
  4770. * @param array $params
  4771. * @return array
  4772. */
  4773. protected static function _createSQLSelectOne($manager, $model, $connection, $select, $params=''){
  4774. }
  4775. /**
  4776. * Creates a resultset from a SQL statement
  4777. *
  4778. * @param Phalcon_Model_Base $model
  4779. * @param Phalcon_Db $connection
  4780. * @param array $select
  4781. * @param resource $resultResource
  4782. * @return Phalcon_Model_Resultset
  4783. */
  4784. protected static function _createResultset($model, $connection, $select, $resultResource){
  4785. }
  4786. /**
  4787. * Sets a transaction related to the Model instance
  4788. *
  4789. *<code>
  4790. *try {
  4791. *
  4792. * $transaction = Phalcon_Transaction_Manager::get();
  4793. *
  4794. * $robot = new Robots();
  4795. * $robot->setTransaction($transaction);
  4796. * $robot->name = 'WALL·E';
  4797. * $robot->created_at = date('Y-m-d');
  4798. * if($robot->save()==false){
  4799. * $transaction->rollback("Can't save robot");
  4800. * }
  4801. *
  4802. * $robotPart = new RobotParts();
  4803. * $robotPart->setTransaction($transaction);
  4804. * $robotPart->type = 'head';
  4805. * if($robotPart->save()==false){
  4806. * $transaction->rollback("Can't save robot part");
  4807. * }
  4808. *
  4809. * $transaction->commit();
  4810. *
  4811. *}
  4812. *catch(Phalcon_Transaction_Failed $e){
  4813. * echo 'Failed, reason: ', $e->getMessage();
  4814. *}
  4815. *
  4816. *</code>
  4817. *
  4818. * @param Phalcon_Transaction $transaction
  4819. */
  4820. public function setTransaction($transaction){
  4821. }
  4822. /**
  4823. * Checks wheter model is mapped to a database view
  4824. *
  4825. * @return boolean
  4826. */
  4827. public function isView(){
  4828. }
  4829. /**
  4830. * Sets table name which model should be mapped
  4831. *
  4832. * @param string $source
  4833. */
  4834. protected function setSource($source){
  4835. }
  4836. /**
  4837. * Returns table name mapped in the model
  4838. *
  4839. * @return string
  4840. */
  4841. public function getSource(){
  4842. }
  4843. /**
  4844. * Sets schema name where table mapped is located
  4845. *
  4846. * @param string $schema
  4847. */
  4848. protected function setSchema($schema){
  4849. }
  4850. /**
  4851. * Returns schema name where table mapped is located
  4852. *
  4853. * @return string
  4854. */
  4855. public function getSchema(){
  4856. }
  4857. /**
  4858. * Overwrites internal Phalcon_Db connection
  4859. *
  4860. * @param Phalcon_Db $connection
  4861. */
  4862. public function setConnection($connection){
  4863. }
  4864. /**
  4865. * Gets internal Phalcon_Db connection
  4866. *
  4867. * @return Phalcon_Db
  4868. */
  4869. public function getConnection(){
  4870. }
  4871. /**
  4872. * Assigns values to a model from an array returning a new model
  4873. *
  4874. *<code>
  4875. *$robot = Phalcon_Model_Base::dumpResult(new Robots(), array(
  4876. * 'type' => 'mechanical',
  4877. * 'name' => 'Astro Boy',
  4878. * 'year' => 1952
  4879. *));
  4880. *</code>
  4881. *
  4882. * @param array $result
  4883. * @param Phalcon_Model_Base $base
  4884. * @return Phalcon_Model_Base $result
  4885. */
  4886. public static function dumpResult($base, $result){
  4887. }
  4888. /**
  4889. * Allows to query a set of records that match the specified conditions
  4890. *
  4891. * <code>
  4892. *
  4893. * //How many robots are there?
  4894. * $robots = Robots::find();
  4895. * echo "There are ", count($robots);
  4896. *
  4897. * //How many mechanical robots are there?
  4898. * $robots = Robots::find("type='mechanical'");
  4899. * echo "There are ", count($robots);
  4900. *
  4901. * //Get and print virtual robots ordered by name
  4902. * $robots = Robots::find(array("type='virtual'", "order" => "name"));
  4903. * foreach($robots as $robot){
  4904. * echo $robot->name, "\n";
  4905. * }
  4906. *
  4907. * //Get first 100 virtual robots ordered by name
  4908. * $robots = Robots::find(array("type='virtual'", "order" => "name", "limit" => 100));
  4909. * foreach($robots as $robot){
  4910. * echo $robot->name, "\n";
  4911. * }
  4912. * </code>
  4913. *
  4914. * @param array $parameters
  4915. * @return Phalcon_Model_Resultset
  4916. */
  4917. public static function find($parameters=NULL){
  4918. }
  4919. /**
  4920. * Allows to query the first record that match the specified conditions
  4921. *
  4922. * <code>
  4923. *
  4924. * //What's the first robot in robots table?
  4925. * $robot = Robots::findFirst();
  4926. * echo "The robot name is ", $robot->name;
  4927. *
  4928. * //What's the first mechanical robot in robots table?
  4929. * $robot = Robots::findFirst("type='mechanical'");
  4930. * echo "The first mechanical robot name is ", $robot->name;
  4931. *
  4932. * //Get first virtual robot ordered by name
  4933. * $robot = Robots::findFirst(array("type='virtual'", "order" => "name"));
  4934. * echo "The first virtual robot name is ", $robot->name;
  4935. *
  4936. * </code>
  4937. *
  4938. * @param array $parameters
  4939. * @return Phalcon_Model_Base
  4940. */
  4941. public static function findFirst($parameters=NULL){
  4942. }
  4943. protected function _exists(){
  4944. }
  4945. protected static function _prepareGroupResult($function, $alias, $parameters){
  4946. }
  4947. protected static function _getGroupResult($connection, $params, $selectStatement, $alias){
  4948. }
  4949. /**
  4950. * Allows to count how many records match the specified conditions
  4951. *
  4952. * <code>
  4953. *
  4954. * //How many robots are there?
  4955. * $number = Robots::count();
  4956. * echo "There are ", $number;
  4957. *
  4958. * //How many mechanical robots are there?
  4959. * $number = Robots::count("type='mechanical'");
  4960. * echo "There are ", $number, " mechanical robots";
  4961. *
  4962. * </code>
  4963. *
  4964. * @param array $params
  4965. * @return int
  4966. */
  4967. public static function count($parameters=NULL){
  4968. }
  4969. /**
  4970. * Allows to a calculate a summatory on a column that match the specified conditions
  4971. *
  4972. * <code>
  4973. *
  4974. * //How much are all robots?
  4975. * $sum = Robots::sum(array('column' => 'price'));
  4976. * echo "The total price of robots is ", $sum;
  4977. *
  4978. * //How much are mechanical robots?
  4979. * $sum = Robots::sum(array("type='mechanical'", 'column' => 'price'));
  4980. * echo "The total price of mechanical robots is ", $sum;
  4981. *
  4982. * </code>
  4983. *
  4984. * @param array $params
  4985. * @return double
  4986. */
  4987. public static function sum($parameters=NULL){
  4988. }
  4989. /**
  4990. * Allows to get the maximum value of a column that match the specified conditions
  4991. *
  4992. * <code>
  4993. *
  4994. * //What is the maximum robot id?
  4995. * $id = Robots::maximum(array('column' => 'id'));
  4996. * echo "The maximum robot id is: ", $id;
  4997. *
  4998. * //What is the maximum id of mechanical robots?
  4999. * $sum = Robots::maximum(array("type='mechanical'", 'column' => 'id'));
  5000. * echo "The maximum robot id of mechanical robots is ", $id;
  5001. *
  5002. * </code>
  5003. *
  5004. * @param array $params
  5005. * @return mixed
  5006. */
  5007. public static function maximum($parameters=NULL){
  5008. }
  5009. /**
  5010. * Allows to get the minimum value of a column that match the specified conditions
  5011. *
  5012. * <code>
  5013. *
  5014. * //What is the minimum robot id?
  5015. * $id = Robots::minimum(array('column' => 'id'));
  5016. * echo "The minimum robot id is: ", $id;
  5017. *
  5018. * //What is the minimum id of mechanical robots?
  5019. * $sum = Robots::minimum(array("type='mechanical'", 'column' => 'id'));
  5020. * echo "The minimum robot id of mechanical robots is ", $id;
  5021. *
  5022. * </code>
  5023. *
  5024. * @param array $params
  5025. * @return mixed
  5026. */
  5027. public static function minimum($parameters=NULL){
  5028. }
  5029. /**
  5030. * Allows to calculate the average value on a column matching the specified conditions
  5031. *
  5032. * <code>
  5033. *
  5034. * //What's the average price of robots?
  5035. * $average = Robots::average(array('column' => 'price'));
  5036. * echo "The average price is ", $average;
  5037. *
  5038. * //What's the average price of mechanical robots?
  5039. * $average = Robots::average(array("type='mechanical'", 'column' => 'price'));
  5040. * echo "The average price of mechanical robots is ", $average;
  5041. *
  5042. * </code>
  5043. *
  5044. * @param array $params
  5045. * @return double
  5046. */
  5047. public static function average($parameters=NULL){
  5048. }
  5049. protected function _callEvent($eventName){
  5050. }
  5051. protected function _cancelOperation(){
  5052. }
  5053. /**
  5054. * Appends a customized message on the validation process
  5055. *
  5056. * <code>
  5057. * class Robots extens Phalcon_Model_Base {
  5058. *
  5059. * function beforeSave(){
  5060. * if(this->name=='Peter'){
  5061. * $message = new Phalcon_Model_Message("Sorry, but a robot cannot be named Peter");
  5062. * $this->appendMessage($message);
  5063. * }
  5064. * }
  5065. * }
  5066. * </code>
  5067. *
  5068. * @param Phalcon_Model_Message $message
  5069. */
  5070. public function appendMessage($message){
  5071. }
  5072. /**
  5073. * Executes validators on every validation call
  5074. *
  5075. *<code>
  5076. *class Subscriptors extends Phalcon_Model_Base {
  5077. *
  5078. * function validation(){
  5079. * $this->validate('ExclusionIn', array(
  5080. * 'field' => 'status',
  5081. * 'domain' => array('A', 'I')
  5082. * ));
  5083. * if($this->validationHasFailed()==true){
  5084. * return false;
  5085. * }
  5086. * }
  5087. *
  5088. *}
  5089. *</code>
  5090. *
  5091. * @param string $validatorClass
  5092. * @param array $options
  5093. */
  5094. protected function validate($validatorClass, $options){
  5095. }
  5096. /**
  5097. * Check whether validation process has generated any messages
  5098. *
  5099. *<code>
  5100. *class Subscriptors extends Phalcon_Model_Base {
  5101. *
  5102. * function validation(){
  5103. * $this->validate('ExclusionIn', array(
  5104. * 'field' => 'status',
  5105. * 'domain' => array('A', 'I')
  5106. * ));
  5107. * if($this->validationHasFailed()==true){
  5108. * return false;
  5109. * }
  5110. * }
  5111. *
  5112. *}
  5113. *</code>
  5114. *
  5115. * @return boolean
  5116. */
  5117. public function validationHasFailed(){
  5118. }
  5119. /**
  5120. * Returns all the validation messages
  5121. *
  5122. * <code>
  5123. *$robot = new Robots();
  5124. *$robot->type = 'mechanical';
  5125. *$robot->name = 'Astro Boy';
  5126. *$robot->year = 1952;
  5127. *if ($robot->save() == false) {
  5128. * echo "Umh, We can't store robots right now ";
  5129. * foreach ($robot->getMessages() as $message) {
  5130. * echo $message;
  5131. * }
  5132. *} else {
  5133. * echo "Great, a new robot was saved successfully!";
  5134. *}
  5135. * </code>
  5136. *
  5137. * @return array
  5138. */
  5139. public function getMessages(){
  5140. }
  5141. protected function _checkForeignKeys(){
  5142. }
  5143. protected function _checkForeignKeysReverse(){
  5144. }
  5145. protected function _preSave($disableEvents, $exists, $identityField){
  5146. }
  5147. protected function _postSave($disableEvents, $success, $exists){
  5148. }
  5149. protected function _doLowInsert($connection, $table, $dataType, $dataTypeNumeric, $identityField){
  5150. }
  5151. protected function _doLowUpdate($connection, $table, $dataType, $dataTypeNumeric){
  5152. }
  5153. /**
  5154. * Inserts or updates a model instance. Returns true on success or else false .
  5155. *
  5156. * <code>
  5157. * //Creating a new robot
  5158. *$robot = new Robots();
  5159. *$robot->type = 'mechanical'
  5160. *$robot->name = 'Astro Boy';
  5161. *$robot->year = 1952;
  5162. *$robot->save();
  5163. *
  5164. * //Updating a robot name
  5165. *$robot = Robots::findFirst("id=100");
  5166. *$robot->name = "Biomass";
  5167. *$robot->save();
  5168. * </code>
  5169. *
  5170. * @return boolean
  5171. */
  5172. public function save(){
  5173. }
  5174. /**
  5175. * Deletes a model instance. Returns true on success or else false .
  5176. *
  5177. * <code>
  5178. *$robot = Robots::findFirst("id=100");
  5179. *$robot->delete();
  5180. *
  5181. *foreach(Robots::find("type = 'mechanical'") as $robot){
  5182. * $robot->delete();
  5183. *}
  5184. * </code>
  5185. *
  5186. * @return boolean
  5187. */
  5188. public function delete(){
  5189. }
  5190. /**
  5191. * Reads an attribute value by its name
  5192. *
  5193. * <code> echo $robot->readAttribute('name'); ?></code>
  5194. *
  5195. * @param string $attribute
  5196. * @return mixed
  5197. */
  5198. public function readAttribute($attribute){
  5199. }
  5200. /**
  5201. * Writes an attribute value by its name
  5202. *
  5203. * <code>$robot->writeAttribute('name', 'Rosey'); ?></code>
  5204. *
  5205. * @param string $attribute
  5206. * @param mixed $value
  5207. */
  5208. public function writeAttribute($attribute, $value){
  5209. }
  5210. /**
  5211. * Setup a 1-1 relation between two models
  5212. *
  5213. *<code>
  5214. *
  5215. *
  5216. *class Robots extends Phalcon_Model_Base {
  5217. *
  5218. * function initialize(){
  5219. * $this->hasOne('id', 'RobotsDescription', 'robots_id');
  5220. * }
  5221. *
  5222. *}
  5223. *</code>
  5224. *
  5225. * @param mixed $fields
  5226. * @param string $referenceModel
  5227. * @param mixed $referencedFields
  5228. * @param array $options
  5229. */
  5230. protected function hasOne($fields, $referenceModel, $referencedFields, $options){
  5231. }
  5232. /**
  5233. * Setup a relation reverse 1-1 between two models
  5234. *
  5235. *<code>
  5236. *
  5237. *
  5238. *class RobotsParts extends Phalcon_Model_Base {
  5239. *
  5240. * function initialize(){
  5241. * $this->belongsTo('robots_id', 'Robots', 'id');
  5242. * }
  5243. *
  5244. *}
  5245. *</code>
  5246. *
  5247. * @param mixed $fields
  5248. * @param string $referenceModel
  5249. * @param mixed $referencedFields
  5250. * @param array $options
  5251. */
  5252. protected function belongsTo($fields, $referenceModel, $referencedFields, $options=array ()){
  5253. }
  5254. /**
  5255. * Setup a relation 1-n between two models
  5256. *
  5257. *<code>
  5258. *
  5259. *
  5260. *class Robots extends Phalcon_Model_Base {
  5261. *
  5262. * function initialize(){
  5263. * $this->hasMany('id', 'RobotsParts', 'robots_id');
  5264. * }
  5265. *
  5266. *}
  5267. *</code>
  5268. *
  5269. * @param mixed $fields
  5270. * @param string $referenceModel
  5271. * @param mixed $referencedFields
  5272. * @param array $options
  5273. */
  5274. protected function hasMany($fields, $referenceModel, $referencedFields, $options=array ()){
  5275. }
  5276. /**
  5277. * Handles methods when a method does not exist
  5278. *
  5279. * @param string $method
  5280. * @param array $arguments
  5281. * @return mixed
  5282. * @throws Phalcon_Model_Exception
  5283. */
  5284. public function __call($method, $arguments=array ()){
  5285. }
  5286. }
  5287. class Phalcon_Model_Exception extends Php_Exception
  5288. {
  5289. final private function __clone(){
  5290. }
  5291. public function __construct($message, $code, $previous){
  5292. }
  5293. final public function getMessage(){
  5294. }
  5295. final public function getCode(){
  5296. }
  5297. final public function getFile(){
  5298. }
  5299. final public function getLine(){
  5300. }
  5301. final public function getTrace(){
  5302. }
  5303. final public function getPrevious(){
  5304. }
  5305. final public function getTraceAsString(){
  5306. }
  5307. public function __toString(){
  5308. }
  5309. }
  5310. /**
  5311. * Phalcon_Model_Manager
  5312. *
  5313. * Manages the creation of models into applications and their relationships.
  5314. * Phacon_Model_Manager helps to control the creation of models across a request execution.
  5315. *
  5316. * <code>
  5317. * $manager = new Phalcon_Model_Manager();
  5318. *$manager->setModelsDir('../apps/models/');
  5319. *$Robots = new Robots($manager);
  5320. * </code>
  5321. */
  5322. class Phalcon_Model_Manager
  5323. {
  5324. /**
  5325. * Constructor for Phalcon_Model_Manager
  5326. *
  5327. * @param array $metaDataOptions
  5328. */
  5329. public function __construct($metaDataOptions=array ()){
  5330. }
  5331. /**
  5332. * Sets base path. Depending of your platform, always add a trailing slash or backslash
  5333. */
  5334. public function setBasePath($basePath){
  5335. }
  5336. /**
  5337. * Overwrites default meta-data manager
  5338. *
  5339. * @param Phalcon_Model_Metadata $metadata
  5340. */
  5341. public function setMetaData($metadata){
  5342. }
  5343. /**
  5344. * Returns active meta-data manager. If not exist then one will be created
  5345. *
  5346. * @return Phalcon_Model_Metadata
  5347. */
  5348. public function getMetaData(){
  5349. }
  5350. /**
  5351. * Sets the models directory. Depending of your platform, always add a trailing slash or backslash
  5352. *
  5353. * @param string $modelsDir
  5354. */
  5355. public function setModelsDir($modelsDir){
  5356. }
  5357. /**
  5358. * Gets active models directory
  5359. *
  5360. * @return string
  5361. */
  5362. public function getModelsDir(){
  5363. }
  5364. /**
  5365. * Checks whether the given name is an existing model
  5366. *
  5367. * <code>
  5368. * //Is there a "Robots" model?
  5369. * $isModel = $manager->isModel('Robots');
  5370. * </code>
  5371. *
  5372. * @param string $modelName
  5373. * @return boolean
  5374. */
  5375. public function isModel($modelName){
  5376. }
  5377. /**
  5378. * Loads a model looking for its file and initializing them
  5379. *
  5380. * @param string $modelName
  5381. * @return boolean
  5382. */
  5383. public function load($modelName){
  5384. }
  5385. /**
  5386. * Gets/Instantiates model from directory
  5387. *
  5388. * <code>
  5389. * //Get the "Robots" model
  5390. * $Robots = $manager->getModel('Robots');
  5391. * </code>
  5392. *
  5393. * @param string $modelName
  5394. * @return boolean
  5395. */
  5396. public function getModel($modelName){
  5397. }
  5398. /**
  5399. * Gets the possible source model name from its class name
  5400. *
  5401. * @param string $modelName
  5402. * @return boolean
  5403. */
  5404. public function getSource($modelName){
  5405. }
  5406. /**
  5407. * Gets default connection to the database. All models by default will use connection returned by this method
  5408. *
  5409. * @return Phalcon_Db
  5410. */
  5411. public function getConnection(){
  5412. }
  5413. /**
  5414. * Setup a 1-1 relation between two models
  5415. *
  5416. * @param Phalcon_Model_Base $model
  5417. * @param mixed $fields
  5418. * @param string $referenceModel
  5419. * @param mixed $referencedFields
  5420. * @param array $options
  5421. */
  5422. public function addHasOne($model, $fields, $referenceModel, $referencedFields, $options=array ()){
  5423. }
  5424. /**
  5425. * Setup a relation reverse 1-1 between two models
  5426. *
  5427. * @param Phalcon_Model_Base $model
  5428. * @param mixed $fields
  5429. * @param string $referenceModel
  5430. * @param mixed $referencedFields
  5431. * @param array $options
  5432. */
  5433. public function addBelongsTo($model, $fields, $referenceModel, $referencedFields, $options=array ()){
  5434. }
  5435. /**
  5436. * Setup a relation 1-n between two models
  5437. *
  5438. * @param Phalcon_Model_Base $model
  5439. * @param mixed $fields
  5440. * @param string $referenceModel
  5441. * @param mixed $referencedFields
  5442. * @param array $options
  5443. */
  5444. public function addHasMany($model, $fields, $referenceModel, $referencedFields, $options=array ()){
  5445. }
  5446. /**
  5447. * Checks whether a model has a belongsTo relation with another model
  5448. *
  5449. * @access public
  5450. * @param string $modelName
  5451. * @param string $modelRelation
  5452. * @return boolean
  5453. */
  5454. public function existsBelongsTo($modelName, $modelRelation){
  5455. }
  5456. /**
  5457. * Checks whether a model has a hasMany relation with another model
  5458. *
  5459. * @param string $modelName
  5460. * @param string $modelRelation
  5461. * @return boolean
  5462. */
  5463. public function existsHasMany($modelName, $modelRelation){
  5464. }
  5465. /**
  5466. * Checks whether a model has a hasOne relation with another model
  5467. *
  5468. * @param string $modelName
  5469. * @param string $modelRelation
  5470. * @return boolean
  5471. */
  5472. public function existsHasOne($modelName, $modelRelation){
  5473. }
  5474. /**
  5475. * Helper method to query records based on a relation definition
  5476. *
  5477. * @param array $relation
  5478. * @param string $method
  5479. * @param Phalcon_Model_Base $record
  5480. */
  5481. protected function _getRelationRecords($relation, $method, $record){
  5482. }
  5483. /**
  5484. * Gets belongsTo related records from a model
  5485. *
  5486. * @param string $method
  5487. * @param string $modelName
  5488. * @param string $modelRelation
  5489. * @param Phalcon_Model_Base $record
  5490. * @return Phalcon_Model_Resultset
  5491. */
  5492. public function getBelongsToRecords($method, $modelName, $modelRelation, $record){
  5493. }
  5494. /**
  5495. * Gets hasMany related records from a model
  5496. *
  5497. * @param string $method
  5498. * @param string $modelName
  5499. * @param string $modelRelation
  5500. * @param Phalcon_Model_Base $record
  5501. * @return Phalcon_Model_Resultset
  5502. */
  5503. public function getHasManyRecords($method, $modelName, $modelRelation, $record){
  5504. }
  5505. /**
  5506. * Gets belongsTo related records from a model
  5507. *
  5508. * @param string $method
  5509. * @param string $modelName
  5510. * @param string $modelRelation
  5511. * @param Phalcon_Model_Base $record
  5512. * @return Phalcon_Model_Resultset
  5513. */
  5514. public function getHasOneRecords($method, $modelName, $modelRelation, $record){
  5515. }
  5516. /**
  5517. * Gets belongsTo relations defined on a model
  5518. *
  5519. * @param Phalcon_Model_Base $model
  5520. * @return array
  5521. */
  5522. public function getBelongsTo($model){
  5523. }
  5524. /**
  5525. * Gets hasMany relations defined on a model
  5526. *
  5527. * @param Phalcon_Model_Base $model
  5528. * @return array
  5529. */
  5530. public function getHasMany($model){
  5531. }
  5532. /**
  5533. * Gets hasOne relations defined on a model
  5534. *
  5535. * @param Phalcon_Model_Base $model
  5536. * @return array
  5537. */
  5538. public function getHasOne($model){
  5539. }
  5540. /**
  5541. * Gets hasOne relations defined on a model
  5542. *
  5543. * @param Phalcon_Model_Base $model
  5544. * @return array
  5545. */
  5546. public function getHasOneAndHasMany($model){
  5547. }
  5548. /**
  5549. * Autoload function for model lazy loading
  5550. *
  5551. * @param string $className
  5552. */
  5553. public function autoload($className){
  5554. }
  5555. }
  5556. /**
  5557. * Phalcon_Model_Message
  5558. *
  5559. * Encapsulates validation info generated before save/delete records fails
  5560. *
  5561. * <code>
  5562. * class Robots extens Phalcon_Model_Base {
  5563. *
  5564. * function beforeSave(){
  5565. * if(this->name=='Peter'){
  5566. * $text = "A robot cannot be named Peter";
  5567. * $field = "name";
  5568. * $type = "InvalidValue";
  5569. * $message = new Phalcon_Model_Message($text, $field, $type);
  5570. * $this->appendMessage($message);
  5571. * }
  5572. * }
  5573. * }
  5574. * </code>
  5575. *
  5576. */
  5577. class Phalcon_Model_Message
  5578. {
  5579. /**
  5580. * Phalcon_Model_Message message
  5581. *
  5582. * @param string $message
  5583. * @param string $field
  5584. * @param string $type
  5585. */
  5586. public function __construct($message, $field=NULL, $type=NULL){
  5587. }
  5588. /**
  5589. * Sets message type
  5590. *
  5591. * @param string $type
  5592. */
  5593. public function setType($type){
  5594. }
  5595. /**
  5596. * Returns message type
  5597. *
  5598. * @return string
  5599. */
  5600. public function getType(){
  5601. }
  5602. /**
  5603. * Sets verbose message
  5604. *
  5605. * @param string $message
  5606. */
  5607. public function setMessage($message){
  5608. }
  5609. /**
  5610. * Returns verbose message
  5611. *
  5612. * @return string
  5613. */
  5614. public function getMessage(){
  5615. }
  5616. /**
  5617. * Sets field name related to message
  5618. *
  5619. * @param string $field
  5620. */
  5621. public function setField($field){
  5622. }
  5623. /**
  5624. * Returns field name related to message
  5625. *
  5626. * @return string
  5627. */
  5628. public function getField(){
  5629. }
  5630. /**
  5631. * Magic __toString method returns verbose message
  5632. *
  5633. * @return string
  5634. */
  5635. public function __toString(){
  5636. }
  5637. /**
  5638. * Magic __set_state helps to recover messsages from serialization
  5639. *
  5640. * @param array $message
  5641. * @return Phalcon_Model_Message
  5642. */
  5643. public static function __set_state($message){
  5644. }
  5645. }
  5646. /**
  5647. * Phalcon_Model_MetaData
  5648. *
  5649. * <p>Because Phalcon_Model requires meta-data like field names, data types, primary keys, etc.
  5650. * this component collect them and store for further querying by Phalcon_Model_Base.
  5651. * Phalcon_Model_MetaData can also use adapters to store temporarily or permanently the meta-data.</p>
  5652. *
  5653. * <p>A standard Phalcon_Model_MetaData can be used to query model attributes:</p>
  5654. *
  5655. * <code>
  5656. *$metaData = new Phalcon_Model_MetaData('Memory');
  5657. *$attributes = $metaData->getAttributes(new Robots());
  5658. *print_r($attributes);
  5659. * </code>
  5660. *
  5661. */
  5662. class Phalcon_Model_MetaData
  5663. {
  5664. const MODELS_ATTRIBUTES = 0;
  5665. const MODELS_PRIMARY_KEY = 1;
  5666. const MODELS_NON_PRIMARY_KEY = 2;
  5667. const MODELS_NOT_NULL = 3;
  5668. const MODELS_DATA_TYPE = 4;
  5669. const MODELS_DATA_TYPE_NUMERIC = 5;
  5670. const MODELS_DATE_AT = 6;
  5671. const MODELS_DATE_IN = 7;
  5672. const MODELS_IDENTITY_FIELD = 8;
  5673. /**
  5674. * Phalcon_Model_MetaData constructor
  5675. *
  5676. * @param string $adapter
  5677. * @param array $options
  5678. */
  5679. public function __construct($adapter, $options=array ()){
  5680. }
  5681. private function _initializeMetaData($model, $table, $schema){
  5682. }
  5683. /**
  5684. * Returns table attributes names (fields)
  5685. *
  5686. * @param Phalcon_Model_Base $model
  5687. * @return array
  5688. */
  5689. public function getAttributes($model){
  5690. }
  5691. /**
  5692. * Returns an array of fields which are part of the primary key
  5693. *
  5694. * @param Phalcon_Model_Base $model
  5695. * @return array
  5696. */
  5697. public function getPrimaryKeyAttributes($model){
  5698. }
  5699. /**
  5700. * Returns an arrau of fields which are not part of the primary key
  5701. *
  5702. * @param Phalcon_Model_Base $model
  5703. * @return array
  5704. */
  5705. public function getNonPrimaryKeyAttributes($model){
  5706. }
  5707. /**
  5708. * Returns an array of not null attributes
  5709. *
  5710. * @param Phalcon_Model_Base $model
  5711. * @return array
  5712. */
  5713. public function getNotNullAttributes($model){
  5714. }
  5715. /**
  5716. * Returns attributes and their data types
  5717. *
  5718. * @param Phalcon_Model_Base $model
  5719. * @return array
  5720. */
  5721. public function getDataTypes($model){
  5722. }
  5723. /**
  5724. * Returns attributes which types are numerical
  5725. *
  5726. * @param Phalcon_Model_Base $model
  5727. * @return array
  5728. */
  5729. public function getDataTypesNumeric($model){
  5730. }
  5731. /**
  5732. * Returns the name of identity field (if one is present)
  5733. *
  5734. * @param Phalcon_Model_Base $model
  5735. * @return array
  5736. */
  5737. public function getIdentityField($model){
  5738. }
  5739. /**
  5740. * Stores meta-data using an adapter
  5741. */
  5742. public function storeMetaData(){
  5743. }
  5744. }
  5745. /**
  5746. * Phalcon_Model_Query
  5747. *
  5748. * Phalcon_Model_Query is designed to simplify building of search on models.
  5749. * It provides a set of helpers to generate searchs in a dynamic way to support differents databases.
  5750. *
  5751. * <code>
  5752. *
  5753. * $query = new Phalcon_Model_Query();
  5754. * $query->setManager($manager);
  5755. * $query->from('Robots');
  5756. * $query->where('id = ?0');
  5757. * $query->where('name LIKE ?1');
  5758. * $query->setParameter(array(0 => '10', 1 => '%Astro%'));
  5759. * foreach($query->getResultset() as $robot){
  5760. * echo $robot->name, "\n";
  5761. * }
  5762. * </code>
  5763. *
  5764. */
  5765. class Phalcon_Model_Query
  5766. {
  5767. /**
  5768. * Set the Phalcon_Model_Manager instance to use in a query
  5769. *
  5770. * <code>
  5771. * $controllerFront = Phalcon_Controller_Front::getInstance();
  5772. * $modelManager = $controllerFront->getModelComponent();
  5773. * $query = new Phalcon_Model_Query();
  5774. * $query->setManager($manager);
  5775. * </code>
  5776. *
  5777. * @param Phalcon_Model_Manager $manager
  5778. */
  5779. public function setManager($manager){
  5780. }
  5781. /**
  5782. * Add models to use in query
  5783. *
  5784. * @param string $model
  5785. */
  5786. public function from($model){
  5787. }
  5788. /**
  5789. * Add conditions to use in query
  5790. *
  5791. * @param string $condition
  5792. */
  5793. public function where($condition){
  5794. }
  5795. /**
  5796. * Set parameter in query to different database adapters.
  5797. *
  5798. * @param string $parameter
  5799. */
  5800. public function setParameters($parameter){
  5801. }
  5802. /**
  5803. * Set the data to use to make the conditions in query
  5804. *
  5805. * @param array $data
  5806. */
  5807. public function setInputData($data){
  5808. }
  5809. /**
  5810. * Set the limit of rows to show
  5811. *
  5812. * @param int $limit
  5813. */
  5814. public function setLimit($limit){
  5815. }
  5816. public function getResultset(){
  5817. }
  5818. /**
  5819. * Get the conditions of query
  5820. *
  5821. * @return string $query
  5822. */
  5823. public function getConditions(){
  5824. }
  5825. /**
  5826. * Get instance of model query
  5827. *
  5828. * @param string $modelName
  5829. * @param array $data
  5830. * @return Phalcon_Model_Query $query
  5831. */
  5832. public static function fromInput($modelName, $data){
  5833. }
  5834. }
  5835. /**
  5836. * Phalcon_Model_Resultset
  5837. *
  5838. * This component allows to Phalcon_Model_Base returns large resulsets with the minimum memory consumption
  5839. * Resulsets can be traversed using a standard foreach or a while statement. If a resultset is serialized
  5840. * it will dump all the rows into a big array. Then unserialize will retrieve the rows as they were before
  5841. * serializing.
  5842. *
  5843. * <code>
  5844. * //Using a standard foreach
  5845. *$robots = $Robots->find(array("type='virtual'", "order" => "name"));
  5846. *foreach($robots as $robot){
  5847. * echo $robot->name, "\n";
  5848. *}
  5849. *
  5850. * //Using a while
  5851. *$robots = $Robots->find(array("type='virtual'", "order" => "name"));
  5852. *$robots->rewind();
  5853. *while($robots->valid()){
  5854. * $robot = $robots->current();
  5855. * echo $robot->name, "\n";
  5856. * $robots->next();
  5857. *}
  5858. * </code>
  5859. *
  5860. */
  5861. class Phalcon_Model_Resultset implements Iterator, Traversable, SeekableIterator, Countable, ArrayAccess, Serializable
  5862. {
  5863. /**
  5864. * Phalcon_Model_Resultset constructor
  5865. *
  5866. * @param Phalcon_Model_Base $model
  5867. * @param resource $resultResource
  5868. */
  5869. public function __construct($model, $resultResource){
  5870. }
  5871. /**
  5872. * Check whether internal resource has rows to fetch
  5873. *
  5874. * @return boolean
  5875. */
  5876. public function valid(){
  5877. }
  5878. /**
  5879. * Returns current row in the resultset
  5880. *
  5881. * @return Phalcon_Model_Base
  5882. */
  5883. public function current(){
  5884. }
  5885. /**
  5886. * Moves cursor to next row in the resultset
  5887. *
  5888. */
  5889. public function next(){
  5890. }
  5891. /**
  5892. * Gets pointer number of active row in the resultset
  5893. *
  5894. */
  5895. public function key(){
  5896. }
  5897. /**
  5898. * Rewinds resultset to its beginning
  5899. *
  5900. */
  5901. public function rewind(){
  5902. }
  5903. /**
  5904. * Changes internal pointer to a specific position in the resultset
  5905. */
  5906. public function seek($position){
  5907. }
  5908. /**
  5909. * Counts how many rows are in the resultset
  5910. *
  5911. * @return int
  5912. */
  5913. public function count(){
  5914. }
  5915. /**
  5916. * Checks whether offset exists in the resultset
  5917. *
  5918. * @param int $index
  5919. * @return boolean
  5920. */
  5921. public function offsetExists($index){
  5922. }
  5923. /**
  5924. * Gets row in a specific position of the resultset
  5925. *
  5926. * @param int $index
  5927. * @return Phalcon_Model_Base
  5928. */
  5929. public function offsetGet($index){
  5930. }
  5931. /**
  5932. * Resulsets cannot be changed. It has only been implemented to meet the definition of the ArrayAccess interface
  5933. *
  5934. * @param int $index
  5935. * @param Phalcon_Model_Base $value
  5936. */
  5937. public function offsetSet($index, $value){
  5938. }
  5939. /**
  5940. * Resulsets cannot be changed. It has only been implemented to meet the definition of the ArrayAccess interface
  5941. *
  5942. * @param int $index
  5943. */
  5944. public function offsetUnset($offset){
  5945. }
  5946. /**
  5947. * Get first row in the resultset
  5948. *
  5949. * @return Phalcon_Model_Base
  5950. */
  5951. public function getFirst(){
  5952. }
  5953. /**
  5954. * Get last row in the resultset
  5955. *
  5956. * @return Phalcon_Model_Base
  5957. */
  5958. public function getLast(){
  5959. }
  5960. /**
  5961. * Serializing a resultset will dump all related rows into a big array
  5962. *
  5963. * @param int $index
  5964. */
  5965. public function serialize(){
  5966. }
  5967. /**
  5968. * Unserializing a resultset will allow to only works on the rows present in the saved state
  5969. *
  5970. * @param int $index
  5971. */
  5972. public function unserialize($data){
  5973. }
  5974. }
  5975. /**
  5976. * Phalcon_Model_Row
  5977. *
  5978. * This component allows to Phalcon_Model_Base returns grouped resultsets.
  5979. */
  5980. class Phalcon_Model_Row
  5981. {
  5982. /**
  5983. * Overwrites default connection
  5984. *
  5985. * @param Phalcon_Db $connection
  5986. */
  5987. public function setConnection($connection){
  5988. }
  5989. /**
  5990. * Returns default connection
  5991. *
  5992. * @return Phalcon_Db
  5993. */
  5994. public function getConnection(){
  5995. }
  5996. /**
  5997. * Assigns values to a row from an array returning a new row
  5998. *
  5999. *<code>
  6000. *$row = new Phalcon_Model_Row();
  6001. *$newRow = $row->dumpResult(array(
  6002. * 'type' => 'mechanical',
  6003. * 'name' => 'Astro Boy',
  6004. * 'year' => 1952
  6005. *));
  6006. *</code>
  6007. *
  6008. * @param array $result
  6009. * @return Phalcon_Model $result
  6010. */
  6011. public function dumpResult($result){
  6012. }
  6013. /**
  6014. * Reads an attribute value by its name
  6015. *
  6016. * <code> echo $robot->readAttribute('name'); ?></code>
  6017. *
  6018. * @param string $attribute
  6019. * @return mixed
  6020. */
  6021. public function readAttribute($property){
  6022. }
  6023. /**
  6024. * Magic method sleep
  6025. *
  6026. * @return array
  6027. */
  6028. public function sleep(){
  6029. }
  6030. }
  6031. class Phalcon_Model_Sanitize
  6032. {
  6033. }
  6034. abstract class Phalcon_Model_Validator
  6035. {
  6036. /**
  6037. * Phalcon_Model_Validator constructor
  6038. *
  6039. * @param Phalcon_Model_Base $record
  6040. * @param string $field
  6041. * @param string $value
  6042. * @param array $options
  6043. */
  6044. public function __construct($record, $fieldName, $value, $options=array ()){
  6045. }
  6046. /**
  6047. * Appends a message to the validator
  6048. *
  6049. * @param string $message
  6050. * @param string $field
  6051. * @param string $type
  6052. */
  6053. protected function appendMessage($message, $field=NULL, $type=NULL){
  6054. }
  6055. /**
  6056. * Returns messages generated by the validator
  6057. *
  6058. * @return array
  6059. */
  6060. public function getMessages(){
  6061. }
  6062. /**
  6063. * Check whether option "required" has been passed as option
  6064. *
  6065. * @return boolean
  6066. */
  6067. protected function isRequired(){
  6068. }
  6069. /**
  6070. * Returns all the options from the validator
  6071. *
  6072. * @return array
  6073. */
  6074. protected function getOptions(){
  6075. }
  6076. /**
  6077. * Returns an option
  6078. *
  6079. * @param string $option
  6080. * @return mixed
  6081. */
  6082. protected function getOption($option){
  6083. }
  6084. /**
  6085. * Check whether a option has been defined in the validator options
  6086. *
  6087. * @param string $option
  6088. * @return boolean
  6089. */
  6090. protected function isSetOption($option){
  6091. }
  6092. /**
  6093. * Returns the value of the validated field
  6094. *
  6095. * @return mixed
  6096. */
  6097. protected function getValue(){
  6098. }
  6099. /**
  6100. * Devuelve el nombre del campo validado
  6101. *
  6102. * @access protected
  6103. * @return string
  6104. */
  6105. protected function getFieldName(){
  6106. }
  6107. /**
  6108. * Returns Phalcon_Model_Base related record
  6109. *
  6110. * @return ActiveRecord
  6111. */
  6112. protected function getRecord(){
  6113. }
  6114. /**
  6115. * This method can be overridden to implement specific option validations for the validator
  6116. *
  6117. */
  6118. public function checkOptions(){
  6119. }
  6120. }
  6121. /**
  6122. * Phalcon_Model_MetaData_Memory
  6123. *
  6124. * Stores model meta-data in memory. Data will be erased when the request finishes
  6125. */
  6126. class Phalcon_Model_MetaData_Memory
  6127. {
  6128. public function read(){
  6129. }
  6130. public function write($data){
  6131. }
  6132. }
  6133. /**
  6134. * Phalcon_Model_MetaData_Session
  6135. *
  6136. * Stores model meta-data in session. Data will erase when the session finishes.
  6137. * Meta-data are permanent while the session is active
  6138. */
  6139. class Phalcon_Model_MetaData_Session
  6140. {
  6141. public function __construct($options){
  6142. }
  6143. public function read(){
  6144. }
  6145. public function write($data){
  6146. }
  6147. }
  6148. /**
  6149. * Phalcon_Model_Validator_Email
  6150. *
  6151. * Let to validate that email fields has correct values
  6152. *
  6153. */
  6154. class Phalcon_Model_Validator_Email extends Php_Model_Validator
  6155. {
  6156. /**
  6157. * Executes the validator
  6158. *
  6159. * @return boolean
  6160. */
  6161. public function validate(){
  6162. }
  6163. /**
  6164. * Phalcon_Model_Validator constructor
  6165. *
  6166. * @param Phalcon_Model_Base $record
  6167. * @param string $field
  6168. * @param string $value
  6169. * @param array $options
  6170. */
  6171. public function __construct($record, $fieldName, $value, $options=array ()){
  6172. }
  6173. /**
  6174. * Appends a message to the validator
  6175. *
  6176. * @param string $message
  6177. * @param string $field
  6178. * @param string $type
  6179. */
  6180. protected function appendMessage($message, $field=NULL, $type=NULL){
  6181. }
  6182. /**
  6183. * Returns messages generated by the validator
  6184. *
  6185. * @return array
  6186. */
  6187. public function getMessages(){
  6188. }
  6189. /**
  6190. * Check whether option "required" has been passed as option
  6191. *
  6192. * @return boolean
  6193. */
  6194. protected function isRequired(){
  6195. }
  6196. /**
  6197. * Returns all the options from the validator
  6198. *
  6199. * @return array
  6200. */
  6201. protected function getOptions(){
  6202. }
  6203. /**
  6204. * Returns an option
  6205. *
  6206. * @param string $option
  6207. * @return mixed
  6208. */
  6209. protected function getOption($option){
  6210. }
  6211. /**
  6212. * Check whether a option has been defined in the validator options
  6213. *
  6214. * @param string $option
  6215. * @return boolean
  6216. */
  6217. protected function isSetOption($option){
  6218. }
  6219. /**
  6220. * Returns the value of the validated field
  6221. *
  6222. * @return mixed
  6223. */
  6224. protected function getValue(){
  6225. }
  6226. /**
  6227. * Devuelve el nombre del campo validado
  6228. *
  6229. * @access protected
  6230. * @return string
  6231. */
  6232. protected function getFieldName(){
  6233. }
  6234. /**
  6235. * Returns Phalcon_Model_Base related record
  6236. *
  6237. * @return ActiveRecord
  6238. */
  6239. protected function getRecord(){
  6240. }
  6241. /**
  6242. * This method can be overridden to implement specific option validations for the validator
  6243. *
  6244. */
  6245. public function checkOptions(){
  6246. }
  6247. }
  6248. /**
  6249. * ExclusionInValidator
  6250. *
  6251. * Check if a value is not included into a list of values
  6252. *
  6253. *<code>
  6254. *class Subscriptors extends Phalcon_Model_Base {
  6255. *
  6256. * function validation(){
  6257. * $this->validate('ExclusionIn', array(
  6258. * 'field' => 'status',
  6259. * 'domain' => array('A', 'I')
  6260. * ));
  6261. * if($this->validationHasFailed()==true){
  6262. * return false;
  6263. * }
  6264. * }
  6265. *
  6266. *}
  6267. *</code>
  6268. */
  6269. class Phalcon_Model_Validator_Exclusionin extends Php_Model_Validator
  6270. {
  6271. /**
  6272. * Check that the options are valid
  6273. *
  6274. */
  6275. public function checkOptions(){
  6276. }
  6277. /**
  6278. * Executes validator
  6279. *
  6280. * @return boolean
  6281. */
  6282. public function validate(){
  6283. }
  6284. /**
  6285. * Phalcon_Model_Validator constructor
  6286. *
  6287. * @param Phalcon_Model_Base $record
  6288. * @param string $field
  6289. * @param string $value
  6290. * @param array $options
  6291. */
  6292. public function __construct($record, $fieldName, $value, $options=array ()){
  6293. }
  6294. /**
  6295. * Appends a message to the validator
  6296. *
  6297. * @param string $message
  6298. * @param string $field
  6299. * @param string $type
  6300. */
  6301. protected function appendMessage($message, $field=NULL, $type=NULL){
  6302. }
  6303. /**
  6304. * Returns messages generated by the validator
  6305. *
  6306. * @return array
  6307. */
  6308. public function getMessages(){
  6309. }
  6310. /**
  6311. * Check whether option "required" has been passed as option
  6312. *
  6313. * @return boolean
  6314. */
  6315. protected function isRequired(){
  6316. }
  6317. /**
  6318. * Returns all the options from the validator
  6319. *
  6320. * @return array
  6321. */
  6322. protected function getOptions(){
  6323. }
  6324. /**
  6325. * Returns an option
  6326. *
  6327. * @param string $option
  6328. * @return mixed
  6329. */
  6330. protected function getOption($option){
  6331. }
  6332. /**
  6333. * Check whether a option has been defined in the validator options
  6334. *
  6335. * @param string $option
  6336. * @return boolean
  6337. */
  6338. protected function isSetOption($option){
  6339. }
  6340. /**
  6341. * Returns the value of the validated field
  6342. *
  6343. * @return mixed
  6344. */
  6345. protected function getValue(){
  6346. }
  6347. /**
  6348. * Devuelve el nombre del campo validado
  6349. *
  6350. * @access protected
  6351. * @return string
  6352. */
  6353. protected function getFieldName(){
  6354. }
  6355. /**
  6356. * Returns Phalcon_Model_Base related record
  6357. *
  6358. * @return ActiveRecord
  6359. */
  6360. protected function getRecord(){
  6361. }
  6362. }
  6363. /**
  6364. * Phalcon_Model_Validator_Inclusionin
  6365. *
  6366. * Check if a value is included into a list of values
  6367. *
  6368. *<code>
  6369. *class Subscriptors extends Phalcon_Model_Base {
  6370. *
  6371. * function validation(){
  6372. * $this->validate('InclusionIn', array(
  6373. * 'field' => 'status',
  6374. * 'domain' => array('P', 'I')
  6375. * ));
  6376. * if($this->validationHasFailed()==true){
  6377. * return false;
  6378. * }
  6379. * }
  6380. *
  6381. *}
  6382. *</code>
  6383. *
  6384. */
  6385. class Phalcon_Model_Validator_Inclusionin extends Php_Model_Validator
  6386. {
  6387. /**
  6388. * Check that the options are valid
  6389. *
  6390. */
  6391. public function checkOptions(){
  6392. }
  6393. /**
  6394. * Executes validator
  6395. *
  6396. * @return boolean
  6397. */
  6398. public function validate(){
  6399. }
  6400. /**
  6401. * Phalcon_Model_Validator constructor
  6402. *
  6403. * @param Phalcon_Model_Base $record
  6404. * @param string $field
  6405. * @param string $value
  6406. * @param array $options
  6407. */
  6408. public function __construct($record, $fieldName, $value, $options=array ()){
  6409. }
  6410. /**
  6411. * Appends a message to the validator
  6412. *
  6413. * @param string $message
  6414. * @param string $field
  6415. * @param string $type
  6416. */
  6417. protected function appendMessage($message, $field=NULL, $type=NULL){
  6418. }
  6419. /**
  6420. * Returns messages generated by the validator
  6421. *
  6422. * @return array
  6423. */
  6424. public function getMessages(){
  6425. }
  6426. /**
  6427. * Check whether option "required" has been passed as option
  6428. *
  6429. * @return boolean
  6430. */
  6431. protected function isRequired(){
  6432. }
  6433. /**
  6434. * Returns all the options from the validator
  6435. *
  6436. * @return array
  6437. */
  6438. protected function getOptions(){
  6439. }
  6440. /**
  6441. * Returns an option
  6442. *
  6443. * @param string $option
  6444. * @return mixed
  6445. */
  6446. protected function getOption($option){
  6447. }
  6448. /**
  6449. * Check whether a option has been defined in the validator options
  6450. *
  6451. * @param string $option
  6452. * @return boolean
  6453. */
  6454. protected function isSetOption($option){
  6455. }
  6456. /**
  6457. * Returns the value of the validated field
  6458. *
  6459. * @return mixed
  6460. */
  6461. protected function getValue(){
  6462. }
  6463. /**
  6464. * Devuelve el nombre del campo validado
  6465. *
  6466. * @access protected
  6467. * @return string
  6468. */
  6469. protected function getFieldName(){
  6470. }
  6471. /**
  6472. * Returns Phalcon_Model_Base related record
  6473. *
  6474. * @return ActiveRecord
  6475. */
  6476. protected function getRecord(){
  6477. }
  6478. }
  6479. /**
  6480. * Phalcon_Model_Validator_Numericality
  6481. *
  6482. *
  6483. */
  6484. class Phalcon_Model_Validator_Numericality extends Php_Model_Validator
  6485. {
  6486. /**
  6487. * Executes the validator
  6488. *
  6489. * @return boolean
  6490. */
  6491. public function validate(){
  6492. }
  6493. /**
  6494. * Phalcon_Model_Validator constructor
  6495. *
  6496. * @param Phalcon_Model_Base $record
  6497. * @param string $field
  6498. * @param string $value
  6499. * @param array $options
  6500. */
  6501. public function __construct($record, $fieldName, $value, $options=array ()){
  6502. }
  6503. /**
  6504. * Appends a message to the validator
  6505. *
  6506. * @param string $message
  6507. * @param string $field
  6508. * @param string $type
  6509. */
  6510. protected function appendMessage($message, $field=NULL, $type=NULL){
  6511. }
  6512. /**
  6513. * Returns messages generated by the validator
  6514. *
  6515. * @return array
  6516. */
  6517. public function getMessages(){
  6518. }
  6519. /**
  6520. * Check whether option "required" has been passed as option
  6521. *
  6522. * @return boolean
  6523. */
  6524. protected function isRequired(){
  6525. }
  6526. /**
  6527. * Returns all the options from the validator
  6528. *
  6529. * @return array
  6530. */
  6531. protected function getOptions(){
  6532. }
  6533. /**
  6534. * Returns an option
  6535. *
  6536. * @param string $option
  6537. * @return mixed
  6538. */
  6539. protected function getOption($option){
  6540. }
  6541. /**
  6542. * Check whether a option has been defined in the validator options
  6543. *
  6544. * @param string $option
  6545. * @return boolean
  6546. */
  6547. protected function isSetOption($option){
  6548. }
  6549. /**
  6550. * Returns the value of the validated field
  6551. *
  6552. * @return mixed
  6553. */
  6554. protected function getValue(){
  6555. }
  6556. /**
  6557. * Devuelve el nombre del campo validado
  6558. *
  6559. * @access protected
  6560. * @return string
  6561. */
  6562. protected function getFieldName(){
  6563. }
  6564. /**
  6565. * Returns Phalcon_Model_Base related record
  6566. *
  6567. * @return ActiveRecord
  6568. */
  6569. protected function getRecord(){
  6570. }
  6571. /**
  6572. * This method can be overridden to implement specific option validations for the validator
  6573. *
  6574. */
  6575. public function checkOptions(){
  6576. }
  6577. }
  6578. /**
  6579. * Phalcon_Model_Validator_Regex
  6580. *
  6581. * Validate that the value of a field matches a regular expression
  6582. *
  6583. *<code>
  6584. *class Subscriptors extends Phalcon_Model_Base {
  6585. *
  6586. * function validation(){
  6587. * $this->validate('Regex', array(
  6588. * 'field' => 'created_at',
  6589. * 'pattern' => '/^[0-9]{4}[-\/](0[1-9]|1[12])[-\/](0[1-9]|[12][0-9]|3[01])$/'
  6590. * ));
  6591. * if($this->validationHasFailed()==true){
  6592. * return false;
  6593. * }
  6594. * }
  6595. *
  6596. *}
  6597. *</code>
  6598. *
  6599. */
  6600. class Phalcon_Model_Validator_Regex extends Php_Model_Validator
  6601. {
  6602. /**
  6603. * Check that the options are correct
  6604. *
  6605. */
  6606. public function checkOptions(){
  6607. }
  6608. /**
  6609. * Executes the validator
  6610. *
  6611. * @return boolean
  6612. */
  6613. public function validate(){
  6614. }
  6615. /**
  6616. * Phalcon_Model_Validator constructor
  6617. *
  6618. * @param Phalcon_Model_Base $record
  6619. * @param string $field
  6620. * @param string $value
  6621. * @param array $options
  6622. */
  6623. public function __construct($record, $fieldName, $value, $options=array ()){
  6624. }
  6625. /**
  6626. * Appends a message to the validator
  6627. *
  6628. * @param string $message
  6629. * @param string $field
  6630. * @param string $type
  6631. */
  6632. protected function appendMessage($message, $field=NULL, $type=NULL){
  6633. }
  6634. /**
  6635. * Returns messages generated by the validator
  6636. *
  6637. * @return array
  6638. */
  6639. public function getMessages(){
  6640. }
  6641. /**
  6642. * Check whether option "required" has been passed as option
  6643. *
  6644. * @return boolean
  6645. */
  6646. protected function isRequired(){
  6647. }
  6648. /**
  6649. * Returns all the options from the validator
  6650. *
  6651. * @return array
  6652. */
  6653. protected function getOptions(){
  6654. }
  6655. /**
  6656. * Returns an option
  6657. *
  6658. * @param string $option
  6659. * @return mixed
  6660. */
  6661. protected function getOption($option){
  6662. }
  6663. /**
  6664. * Check whether a option has been defined in the validator options
  6665. *
  6666. * @param string $option
  6667. * @return boolean
  6668. */
  6669. protected function isSetOption($option){
  6670. }
  6671. /**
  6672. * Returns the value of the validated field
  6673. *
  6674. * @return mixed
  6675. */
  6676. protected function getValue(){
  6677. }
  6678. /**
  6679. * Devuelve el nombre del campo validado
  6680. *
  6681. * @access protected
  6682. * @return string
  6683. */
  6684. protected function getFieldName(){
  6685. }
  6686. /**
  6687. * Returns Phalcon_Model_Base related record
  6688. *
  6689. * @return ActiveRecord
  6690. */
  6691. protected function getRecord(){
  6692. }
  6693. }
  6694. /**
  6695. * Phalcon_Model_Validator_Uniqueness
  6696. *
  6697. * Validates that a field or a combination of a set of fields are not
  6698. * present more than once in the existing records of the related table
  6699. *
  6700. *<code>
  6701. *class Subscriptors extends Phalcon_Model_Base {
  6702. *
  6703. * function validation(){
  6704. * $this->validate('Uniqueness', array(
  6705. * 'field' => 'email'
  6706. * ));
  6707. * if($this->validationHasFailed()==true){
  6708. * return false;
  6709. * }
  6710. * }
  6711. *
  6712. *}
  6713. *</code>
  6714. *
  6715. */
  6716. class Phalcon_Model_Validator_Uniqueness extends Php_Model_Validator
  6717. {
  6718. /**
  6719. * Executes the validator
  6720. *
  6721. * @return boolean
  6722. */
  6723. public function validate(){
  6724. }
  6725. /**
  6726. * Phalcon_Model_Validator constructor
  6727. *
  6728. * @param Phalcon_Model_Base $record
  6729. * @param string $field
  6730. * @param string $value
  6731. * @param array $options
  6732. */
  6733. public function __construct($record, $fieldName, $value, $options=array ()){
  6734. }
  6735. /**
  6736. * Appends a message to the validator
  6737. *
  6738. * @param string $message
  6739. * @param string $field
  6740. * @param string $type
  6741. */
  6742. protected function appendMessage($message, $field=NULL, $type=NULL){
  6743. }
  6744. /**
  6745. * Returns messages generated by the validator
  6746. *
  6747. * @return array
  6748. */
  6749. public function getMessages(){
  6750. }
  6751. /**
  6752. * Check whether option "required" has been passed as option
  6753. *
  6754. * @return boolean
  6755. */
  6756. protected function isRequired(){
  6757. }
  6758. /**
  6759. * Returns all the options from the validator
  6760. *
  6761. * @return array
  6762. */
  6763. protected function getOptions(){
  6764. }
  6765. /**
  6766. * Returns an option
  6767. *
  6768. * @param string $option
  6769. * @return mixed
  6770. */
  6771. protected function getOption($option){
  6772. }
  6773. /**
  6774. * Check whether a option has been defined in the validator options
  6775. *
  6776. * @param string $option
  6777. * @return boolean
  6778. */
  6779. protected function isSetOption($option){
  6780. }
  6781. /**
  6782. * Returns the value of the validated field
  6783. *
  6784. * @return mixed
  6785. */
  6786. protected function getValue(){
  6787. }
  6788. /**
  6789. * Devuelve el nombre del campo validado
  6790. *
  6791. * @access protected
  6792. * @return string
  6793. */
  6794. protected function getFieldName(){
  6795. }
  6796. /**
  6797. * Returns Phalcon_Model_Base related record
  6798. *
  6799. * @return ActiveRecord
  6800. */
  6801. protected function getRecord(){
  6802. }
  6803. /**
  6804. * This method can be overridden to implement specific option validations for the validator
  6805. *
  6806. */
  6807. public function checkOptions(){
  6808. }
  6809. }
  6810. class Phalcon_Paginator_Exception extends Php_Exception
  6811. {
  6812. /**
  6813. * Paginator Exception
  6814. *
  6815. * @param string $message
  6816. */
  6817. public function __construct($message){
  6818. }
  6819. final private function __clone(){
  6820. }
  6821. final public function getMessage(){
  6822. }
  6823. final public function getCode(){
  6824. }
  6825. final public function getFile(){
  6826. }
  6827. final public function getLine(){
  6828. }
  6829. final public function getTrace(){
  6830. }
  6831. final public function getPrevious(){
  6832. }
  6833. final public function getTraceAsString(){
  6834. }
  6835. public function __toString(){
  6836. }
  6837. }
  6838. /**
  6839. * Array_Paginator
  6840. *
  6841. * Component of pagination by array data
  6842. *
  6843. */
  6844. class Phalcon_Paginator_Adapter_Array
  6845. {
  6846. /**
  6847. * Phalcon_Paginator_Adapter_Array constructor
  6848. *
  6849. * @param array $config
  6850. */
  6851. public function __construct($config){
  6852. }
  6853. /**
  6854. * Set the current page number
  6855. *
  6856. * @param int $page
  6857. */
  6858. public function setCurrentPage($page){
  6859. }
  6860. /**
  6861. * Returns a slice of the resultset to show in the pagination
  6862. *
  6863. * @return stdClass
  6864. */
  6865. public function getPaginate(){
  6866. }
  6867. }
  6868. /**
  6869. * Phalcon_Paginator_Adapter_Model
  6870. *
  6871. * This adapter allows to paginate data using Phalcon_Model resultsets.
  6872. *
  6873. */
  6874. class Phalcon_Paginator_Adapter_Model
  6875. {
  6876. /**
  6877. * Phalcon_Paginator_Adapter_Model constructor
  6878. *
  6879. * @param array $config
  6880. */
  6881. public function __construct($config){
  6882. }
  6883. /**
  6884. * Set the current page number
  6885. *
  6886. * @param int $page
  6887. */
  6888. public function setCurrentPage($page){
  6889. }
  6890. /**
  6891. * Returns a slice of the resultset to show in the pagination
  6892. *
  6893. * @return stdClass
  6894. */
  6895. public function getPaginate(){
  6896. }
  6897. }
  6898. /**
  6899. * Phalcon_Request_File
  6900. *
  6901. * Provides OO wrappers to the $_FILES superglobal
  6902. */
  6903. class Phalcon_Request_File
  6904. {
  6905. public function __construct($file){
  6906. }
  6907. public function getSize(){
  6908. }
  6909. public function getName(){
  6910. }
  6911. public function getTempName(){
  6912. }
  6913. }
  6914. /**
  6915. * Phalcon_Router_Regex
  6916. *
  6917. * <p>Phalcon_Router_Regex is the standard framework router. Routing is the
  6918. * process of taking a URI endpoint (that part of the URI which comes after the base URL) and
  6919. * decomposing it into parameters to determine which module, controller, and
  6920. * action of that controller should receive the request</p>
  6921. *
  6922. *<code>
  6923. *$router = new Phalcon_Router_Rewrite();
  6924. *$router->handle();
  6925. *echo $router->getControllerName();
  6926. *</code>
  6927. *
  6928. * Settings baseUri first:
  6929. *
  6930. *<code>
  6931. *$router = new Phalcon_Router_Regex();
  6932. *$router->handle();
  6933. *echo $router->getControllerName();
  6934. *</code>
  6935. *</example>
  6936. */
  6937. class Phalcon_Router_Regex
  6938. {
  6939. public function __construct(){
  6940. }
  6941. /**
  6942. * Get rewrite info
  6943. */
  6944. protected function _getRewriteUri(){
  6945. }
  6946. /**
  6947. * Set the base of application
  6948. *
  6949. * @param string $baseUri
  6950. */
  6951. public function setBaseUri($baseUri){
  6952. }
  6953. public function compilePattern($pattern){
  6954. }
  6955. public function add($pattern, $parts){
  6956. }
  6957. /**
  6958. * Handles routing information received from the rewrite engine
  6959. *
  6960. * @param string $uri
  6961. */
  6962. public function handle($uri=NULL){
  6963. }
  6964. /**
  6965. * Returns proccesed controller name
  6966. *
  6967. * @return string
  6968. */
  6969. public function getControllerName(){
  6970. }
  6971. /**
  6972. * Returns proccesed action name
  6973. *
  6974. * @return string
  6975. */
  6976. public function getActionName(){
  6977. }
  6978. /**
  6979. * Returns proccesed extra params
  6980. *
  6981. * @return array
  6982. */
  6983. public function getParams(){
  6984. }
  6985. }
  6986. /**
  6987. * Phalcon_Router_Rewrite
  6988. *
  6989. * <p>Phalcon_Router_Rewrite is the standard framework router. Routing is the
  6990. * process of taking a URI endpoint (that part of the URI which comes after the base URL) and
  6991. * decomposing it into parameters to determine which module, controller, and
  6992. * action of that controller should receive the request</p>
  6993. *
  6994. *<example>
  6995. *Rewrite rules using a single document root:
  6996. *<code>
  6997. *RewriteEngine On
  6998. *RewriteCond %{REQUEST_FILENAME} -s [OR]
  6999. *RewriteCond %{REQUEST_FILENAME} -l [OR]
  7000. *RewriteCond %{REQUEST_FILENAME} -d
  7001. *RewriteRule ^.*$ - [NC,L]
  7002. *RewriteRule ^.*$ index.php [NC,L]
  7003. *</code>
  7004. *
  7005. *Rewrite rules using a hidden directory and a public/ document root:
  7006. *<code>
  7007. *RewriteEngine on
  7008. *RewriteRule ^$ public/ [L]
  7009. *RewriteRule (.*) public/$1 [L]
  7010. *</code>
  7011. *
  7012. * On public/.htaccess:
  7013. *
  7014. *<code>
  7015. *RewriteEngine On
  7016. *RewriteCond %{REQUEST_FILENAME} !-d
  7017. *RewriteCond %{REQUEST_FILENAME} !-f
  7018. *RewriteRule ^(.*)$ index.php?_url=$1 [QSA,L]
  7019. *</code>
  7020. *
  7021. * The component can be used as follows:
  7022. *
  7023. *<code>
  7024. *$router = new Phalcon_Router_Rewrite();
  7025. *$router->handle();
  7026. *echo $router->getControllerName();
  7027. *</code>
  7028. *</example>
  7029. */
  7030. class Phalcon_Router_Rewrite
  7031. {
  7032. /**
  7033. * Get rewrite info
  7034. */
  7035. protected function _getRewriteUri(){
  7036. }
  7037. /**
  7038. * Set a uri prefix. This will be replaced from the beginning of the uri
  7039. */
  7040. public function setPrefix($prefix){
  7041. }
  7042. /**
  7043. * Handles routing information received from the rewrite engine
  7044. *
  7045. * @param string $uri
  7046. */
  7047. public function handle($uri=NULL){
  7048. }
  7049. /**
  7050. * Returns proccesed controller name
  7051. *
  7052. * @return string
  7053. */
  7054. public function getControllerName(){
  7055. }
  7056. /**
  7057. * Returns proccesed action name
  7058. *
  7059. * @return string
  7060. */
  7061. public function getActionName(){
  7062. }
  7063. /**
  7064. * Returns proccesed extra params
  7065. *
  7066. * @return array
  7067. */
  7068. public function getParams(){
  7069. }
  7070. }
  7071. /**
  7072. * Phalcon_Session_Namespace
  7073. *
  7074. * This component helps to separate session data into namespaces. Working by this way
  7075. * you can easily create groups of session variables into the application
  7076. */
  7077. class Phalcon_Session_Namespace
  7078. {
  7079. /**
  7080. * Constructo of class
  7081. *
  7082. * @param string $name
  7083. */
  7084. public function __construct($name){
  7085. }
  7086. /**
  7087. * Setter of values
  7088. *
  7089. * @param string $property
  7090. * @param string $value
  7091. */
  7092. public function __set($property, $value){
  7093. }
  7094. /**
  7095. * Getter of values
  7096. *
  7097. * @param string $property
  7098. * @return string
  7099. */
  7100. public function __get($property){
  7101. }
  7102. }
  7103. class Phalcon_Tag_Exception extends Php_Exception
  7104. {
  7105. /**
  7106. * Paginator Exception
  7107. *
  7108. * @param string $message
  7109. */
  7110. public function __construct($message){
  7111. }
  7112. final private function __clone(){
  7113. }
  7114. final public function getMessage(){
  7115. }
  7116. final public function getCode(){
  7117. }
  7118. final public function getFile(){
  7119. }
  7120. final public function getLine(){
  7121. }
  7122. final public function getTrace(){
  7123. }
  7124. final public function getPrevious(){
  7125. }
  7126. final public function getTraceAsString(){
  7127. }
  7128. public function __toString(){
  7129. }
  7130. }
  7131. abstract class Phalcon_Tag_Select
  7132. {
  7133. public static function select($parameters, $data=NULL){
  7134. }
  7135. protected static function _optionsFromResultset($resultset, $using, $value, $closeOption){
  7136. }
  7137. protected static function _optionsFromArray($data, $value, $closeOption){
  7138. }
  7139. }
  7140. /**
  7141. * Phalcon_Transaction_Failed
  7142. *
  7143. * Phalcon_Transaction_Failed will thrown to exit a try/catch block for transactions
  7144. *
  7145. */
  7146. class Phalcon_Transaction_Failed extends Exception
  7147. {
  7148. /**
  7149. * Phalcon_Transaction_Failed constructor
  7150. *
  7151. * @param string $message
  7152. * @param Phalcon_Model_Base $record
  7153. */
  7154. public function __construct($message, $record){
  7155. }
  7156. /**
  7157. * Returns validation record messages which stop the transaction
  7158. *
  7159. * @return string
  7160. */
  7161. public function getRecordMessages(){
  7162. }
  7163. /**
  7164. * Returns validation record messages which stop the transaction
  7165. *
  7166. * @return Phalcon_Model_Base
  7167. */
  7168. public function getRecord(){
  7169. }
  7170. final private function __clone(){
  7171. }
  7172. final public function getMessage(){
  7173. }
  7174. final public function getCode(){
  7175. }
  7176. final public function getFile(){
  7177. }
  7178. final public function getLine(){
  7179. }
  7180. final public function getTrace(){
  7181. }
  7182. final public function getPrevious(){
  7183. }
  7184. final public function getTraceAsString(){
  7185. }
  7186. public function __toString(){
  7187. }
  7188. }
  7189. /**
  7190. * Phalcon_Transaction_Manager
  7191. *
  7192. * A transaction acts on a single database connection. If you have multiple class-specific
  7193. * databases, the transaction will not protect interaction among them
  7194. *
  7195. *<code>
  7196. *try {
  7197. *
  7198. * $transaction = Phalcon_Transaction_Manager::get();
  7199. *
  7200. * $robot = new Robots();
  7201. * $robot->setTransaction($transaction);
  7202. * $robot->name = 'WALL·E';
  7203. * $robot->created_at = date('Y-m-d');
  7204. * if($robot->save()==false){
  7205. * $transaction->rollback("Can't save robot");
  7206. * }
  7207. *
  7208. * $robotPart = new RobotParts();
  7209. * $robotPart->setTransaction($transaction);
  7210. * $robotPart->type = 'head';
  7211. * if($robotPart->save()==false){
  7212. * $transaction->rollback("Can't save robot part");
  7213. * }
  7214. *
  7215. * $transaction->commit();
  7216. *
  7217. *}
  7218. *catch(Phalcon_Transaction_Failed $e){
  7219. * echo 'Failed, reason: ', $e->getMessage();
  7220. *}
  7221. *
  7222. *</code>
  7223. *
  7224. */
  7225. class Phalcon_Transaction_Manager
  7226. {
  7227. /**
  7228. * Checks whether manager has an active transaction
  7229. *
  7230. * @return boolean
  7231. */
  7232. public static function has(){
  7233. }
  7234. /**
  7235. * Returns a new Phalcon_Transaction or an already created once
  7236. *
  7237. * @param boolean $autoBegin
  7238. * @return Phalcon_Transaction
  7239. */
  7240. public static function get($autoBegin=true){
  7241. }
  7242. /**
  7243. * Rollbacks active transactions whithin the manager
  7244. *
  7245. */
  7246. public static function rollbackPendent(){
  7247. }
  7248. /**
  7249. * Commmits active transactions whithin the manager
  7250. *
  7251. */
  7252. public static function commit(){
  7253. }
  7254. /**
  7255. * Rollbacks active transactions whithin the manager
  7256. * Collect will remove transaction from the manager
  7257. *
  7258. * @param boolean $collect
  7259. */
  7260. public static function rollback($collect=false){
  7261. }
  7262. /**
  7263. * Notifies the manager about a rollbacked transaction
  7264. *
  7265. * @param Phalcon_Transaction $transaction
  7266. */
  7267. public static function notifyRollback($transaction){
  7268. }
  7269. /**
  7270. * Notifies the manager about a commited transaction
  7271. *
  7272. * @param Phalcon_Transaction $transaction
  7273. */
  7274. public static function notifyCommit($transaction){
  7275. }
  7276. private static function _collectTransaction($transaction){
  7277. }
  7278. /**
  7279. * Remove all the transactions from the manager
  7280. *
  7281. */
  7282. public static function collectTransactions(){
  7283. }
  7284. /**
  7285. * Checks whether manager will inject an automatic transaction to all newly
  7286. * created instances of Phalcon_Model_base
  7287. *
  7288. * @return boolean
  7289. */
  7290. public static function isAutomatic(){
  7291. }
  7292. /**
  7293. * Returns automatic transaction for instances of Phalcon_Model_base
  7294. *
  7295. * @return Phalcon_Transaction
  7296. */
  7297. public static function getAutomatic(){
  7298. }
  7299. }
  7300. /**
  7301. * Phalcon_Translate_Exception
  7302. *
  7303. * Class for exceptions thrown by Phalcon_Translate
  7304. */
  7305. class Phalcon_Translate_Exception extends Php_Exception
  7306. {
  7307. final private function __clone(){
  7308. }
  7309. public function __construct($message, $code, $previous){
  7310. }
  7311. final public function getMessage(){
  7312. }
  7313. final public function getCode(){
  7314. }
  7315. final public function getFile(){
  7316. }
  7317. final public function getLine(){
  7318. }
  7319. final public function getTrace(){
  7320. }
  7321. final public function getPrevious(){
  7322. }
  7323. final public function getTraceAsString(){
  7324. }
  7325. public function __toString(){
  7326. }
  7327. }
  7328. /**
  7329. * Phalcon_Translate_Adapter_Array
  7330. *
  7331. * Allows to define translation lists using PHP arrays
  7332. *
  7333. */
  7334. class Phalcon_Translate_Adapter_Array
  7335. {
  7336. /**
  7337. * Phalcon_Translate_Adapter_Array constructor
  7338. *
  7339. * @param array $data
  7340. */
  7341. public function __construct($options){
  7342. }
  7343. /**
  7344. * Returns the translation related to the given key
  7345. *
  7346. * @param string $index
  7347. * @return string
  7348. */
  7349. public function query($index){
  7350. }
  7351. /**
  7352. * Check whether is defined a translation key in the internal array
  7353. *
  7354. * @param string $index
  7355. * @return string
  7356. */
  7357. public function exists($index){
  7358. }
  7359. }
  7360. /**
  7361. * Phalcon_View_Engine
  7362. *
  7363. * All the template engine adapters must inherit this class. This provides
  7364. * basic interfacing between the engine and the Phalcon_View component.
  7365. */
  7366. class Phalcon_View_Engine
  7367. {
  7368. /**
  7369. * Phalcon_View_Engine constructor
  7370. *
  7371. * @param Phalcon_View $view
  7372. * @param array $options
  7373. * @param array $params
  7374. */
  7375. public function __construct($view, $options){
  7376. }
  7377. /**
  7378. * Initializes the engine adapter
  7379. *
  7380. * @param Phalcon_View $view
  7381. * @param array $options
  7382. */
  7383. public function initialize($view, $options){
  7384. }
  7385. /**
  7386. * Gets the name of the controller rendered
  7387. *
  7388. * @return string
  7389. */
  7390. public function getControllerName(){
  7391. }
  7392. /**
  7393. * Gets the name of the action rendered
  7394. *
  7395. * @return string
  7396. */
  7397. public function getActionName(){
  7398. }
  7399. /**
  7400. * Returns cached ouput on another view stage
  7401. *
  7402. * @return array
  7403. */
  7404. public function getContent(){
  7405. }
  7406. /**
  7407. * Generates a external absolute path to an application uri
  7408. *
  7409. * @param array|string $params
  7410. * @return string
  7411. */
  7412. public function url($params=NULL){
  7413. }
  7414. /**
  7415. * Returns a local path
  7416. *
  7417. * @param array|string $params
  7418. * @return string
  7419. */
  7420. public function path($params=''){
  7421. }
  7422. /**
  7423. * Renders a partial inside another view
  7424. *
  7425. * @param string $partialPath
  7426. */
  7427. public function partial($partialPath){
  7428. }
  7429. }
  7430. /**
  7431. * Phalcon_View_Exception
  7432. *
  7433. * Class for exceptions thrown by Phalcon_View
  7434. */
  7435. class Phalcon_View_Exception extends Php_Exception
  7436. {
  7437. final private function __clone(){
  7438. }
  7439. public function __construct($message, $code, $previous){
  7440. }
  7441. final public function getMessage(){
  7442. }
  7443. final public function getCode(){
  7444. }
  7445. final public function getFile(){
  7446. }
  7447. final public function getLine(){
  7448. }
  7449. final public function getTrace(){
  7450. }
  7451. final public function getPrevious(){
  7452. }
  7453. final public function getTraceAsString(){
  7454. }
  7455. public function __toString(){
  7456. }
  7457. }
  7458. /**
  7459. * Phalcon_View_Engine_Mustache
  7460. *
  7461. * Adapter to use Mustache library as templating engine
  7462. */
  7463. class Phalcon_View_Engine_Mustache extends Php_View_Engine
  7464. {
  7465. /**
  7466. * Phalcon_View_Engine_Mustache constructor
  7467. *
  7468. * @param Phalcon_View $view
  7469. * @param array $options
  7470. */
  7471. public function __construct($view, $options){
  7472. }
  7473. /**
  7474. * Renders a view using the template engine
  7475. *
  7476. * @param string $path
  7477. * @param array $params
  7478. */
  7479. public function render($path, $params){
  7480. }
  7481. public function __isset($property){
  7482. }
  7483. public function __get($property){
  7484. }
  7485. public function __call($method, $arguments){
  7486. }
  7487. /**
  7488. * Initializes the engine adapter
  7489. *
  7490. * @param Phalcon_View $view
  7491. * @param array $options
  7492. */
  7493. public function initialize($view, $options){
  7494. }
  7495. /**
  7496. * Gets the name of the controller rendered
  7497. *
  7498. * @return string
  7499. */
  7500. public function getControllerName(){
  7501. }
  7502. /**
  7503. * Gets the name of the action rendered
  7504. *
  7505. * @return string
  7506. */
  7507. public function getActionName(){
  7508. }
  7509. /**
  7510. * Returns cached ouput on another view stage
  7511. *
  7512. * @return array
  7513. */
  7514. public function getContent(){
  7515. }
  7516. /**
  7517. * Generates a external absolute path to an application uri
  7518. *
  7519. * @param array|string $params
  7520. * @return string
  7521. */
  7522. public function url($params=NULL){
  7523. }
  7524. /**
  7525. * Returns a local path
  7526. *
  7527. * @param array|string $params
  7528. * @return string
  7529. */
  7530. public function path($params=''){
  7531. }
  7532. /**
  7533. * Renders a partial inside another view
  7534. *
  7535. * @param string $partialPath
  7536. */
  7537. public function partial($partialPath){
  7538. }
  7539. }
  7540. /**
  7541. *
  7542. * Phalcon_View_Engine_Php
  7543. *
  7544. * Adapter to use PHP itself as templating engine
  7545. */
  7546. class Phalcon_View_Engine_Php extends Php_View_Engine
  7547. {
  7548. /**
  7549. * Phalcon_View_Engine_Php constructor
  7550. *
  7551. * @param Phalcon_View $view
  7552. * @param array $options
  7553. */
  7554. public function __construct($view, $options){
  7555. }
  7556. /**
  7557. * Renders a view using the template engine
  7558. *
  7559. * @param string $path
  7560. * @param array $params
  7561. */
  7562. public function render($path, $params){
  7563. }
  7564. /**
  7565. * Initializes the engine adapter
  7566. *
  7567. * @param Phalcon_View $view
  7568. * @param array $options
  7569. */
  7570. public function initialize($view, $options){
  7571. }
  7572. /**
  7573. * Gets the name of the controller rendered
  7574. *
  7575. * @return string
  7576. */
  7577. public function getControllerName(){
  7578. }
  7579. /**
  7580. * Gets the name of the action rendered
  7581. *
  7582. * @return string
  7583. */
  7584. public function getActionName(){
  7585. }
  7586. /**
  7587. * Returns cached ouput on another view stage
  7588. *
  7589. * @return array
  7590. */
  7591. public function getContent(){
  7592. }
  7593. /**
  7594. * Generates a external absolute path to an application uri
  7595. *
  7596. * @param array|string $params
  7597. * @return string
  7598. */
  7599. public function url($params=NULL){
  7600. }
  7601. /**
  7602. * Returns a local path
  7603. *
  7604. * @param array|string $params
  7605. * @return string
  7606. */
  7607. public function path($params=''){
  7608. }
  7609. /**
  7610. * Renders a partial inside another view
  7611. *
  7612. * @param string $partialPath
  7613. */
  7614. public function partial($partialPath){
  7615. }
  7616. }
  7617. /**
  7618. * Phalcon_View_Engine_Twig
  7619. *
  7620. * Adapter to use Twig library as templating engine
  7621. */
  7622. class Phalcon_View_Engine_Twig extends Php_View_Engine
  7623. {
  7624. /**
  7625. * Phalcon_View_Engine_Twig constructor
  7626. *
  7627. * @param Phalcon_View $view
  7628. * @param array $options
  7629. * @param array $params
  7630. */
  7631. public function __construct($view, $options){
  7632. }
  7633. /**
  7634. * Renders a view using the template engine
  7635. *
  7636. * @param string $path
  7637. * @param array $params
  7638. */
  7639. public function render($path, $params){
  7640. }
  7641. /**
  7642. * Initializes the engine adapter
  7643. *
  7644. * @param Phalcon_View $view
  7645. * @param array $options
  7646. */
  7647. public function initialize($view, $options){
  7648. }
  7649. /**
  7650. * Gets the name of the controller rendered
  7651. *
  7652. * @return string
  7653. */
  7654. public function getControllerName(){
  7655. }
  7656. /**
  7657. * Gets the name of the action rendered
  7658. *
  7659. * @return string
  7660. */
  7661. public function getActionName(){
  7662. }
  7663. /**
  7664. * Returns cached ouput on another view stage
  7665. *
  7666. * @return array
  7667. */
  7668. public function getContent(){
  7669. }
  7670. /**
  7671. * Generates a external absolute path to an application uri
  7672. *
  7673. * @param array|string $params
  7674. * @return string
  7675. */
  7676. public function url($params=NULL){
  7677. }
  7678. /**
  7679. * Returns a local path
  7680. *
  7681. * @param array|string $params
  7682. * @return string
  7683. */
  7684. public function path($params=''){
  7685. }
  7686. /**
  7687. * Renders a partial inside another view
  7688. *
  7689. * @param string $partialPath
  7690. */
  7691. public function partial($partialPath){
  7692. }
  7693. }
  7694. }