Category: Phalcon Database

  • Phalcon Model Transactions

    A model transaction helps to maintain the integrity of the database after the operations such as insert/delete/update/rollback etc. Transaction checks whether the operations are successfully completed or not before committing the database. Transactions are of 3 types: Manual Transactions This method is used when there is only one connection and easy transaction. This transaction can…

  • Phalcon Model Events

    Models allows user to implement events when operation such as insert/update/delete is implemented to define business rules. The following are the events supported by Phalcon\Mvc\Model: Operation Name Description Inserting afterCreate It runs after the required operation over the database system only when an inserting operation is being made. Updating afterUpdate It runs after the required…

  • Phalcon Model Behaviours

    Behaviour is shared conducts which is used by the models to reuse the code. The ORM provides an API to implement behaviours in the models. To implement behaviour we have alternative such as events and callbacks which increases the efficiency of behaviours. Build-in behaviours are as follows: Name Description Timestampable It allows to automatically updates…

  • Phalcon Models

    Model consists of information or data of the application. It manipulates the data by managing the rules. It is found under directory Phalcon\Mvc\Model which remain same for all basic application. It provides following services: Below are the lists of some features which can be Enable/Disable specific feature: Option Description Default astCache Enables/Disables callbacks, hooks and event notifications…

  • Phalcon Query Language (PHQL)

    It allows user to implement query language similar to SQL query language. PHQL is implemented as a parser which connects to RDBMS. Phalcon parser uses same technology as SQLite. PHQL consist of features which are listed below: PHQL Life Cycle PHQL allows developers the ability to personalize and customize accordingly. The following is the lifecycle…

  • Phalcon Transactions and Nested Transactions

    Transaction is supported in Phalcon as it is attached with PDO. To increase the performance of the database we can perform data manipulation. Below is the database structure on which transaction is applied: Transaction example: // Database ‘Company’ data deleted. Nested Transaction Example: // Database ‘Company’ data deleted. Event Name Triggered Break Operation afterConnect After a successfully connection to…

  • Insert/Update/Delete Rows

    Inserting Rows Output: Updating Rows Output: Deleting Rows

  • Phalcon Connecting to Database

    We connect the front-end with the backend i.e. database. To access the database we required username and password. Below we connect to the database name: javatpoint and defining configuration file. Example Output:

  • Phalcon Layer

    It powers the model layer in the framework. It is found under the directory Phalcon\Db. It consists of abstraction layer which is written in C programming language. Database Adapter Phalcon uses PDO_ to connect to databases. It supports following Database engines: Class Description Phalcon\Db\Adapter\Pdo\Mysql It is the most used relational database management system (RDBMS) that runs…