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

/ide/0.4.1/inspector.php

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