https://github.com/bakaphp/database
Wrapper for Phalcon Model that add behavior to work with Custom Fields (vertical tables)
https://github.com/bakaphp/database
database mysql phalcon-framework phalcon-php phalconphp
Last synced: 12 months ago
JSON representation
Wrapper for Phalcon Model that add behavior to work with Custom Fields (vertical tables)
- Host: GitHub
- URL: https://github.com/bakaphp/database
- Owner: bakaphp
- License: mit
- Created: 2018-02-22T00:08:46.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-09-09T14:50:01.000Z (over 5 years ago)
- Last Synced: 2025-03-24T16:43:36.942Z (12 months ago)
- Topics: database, mysql, phalcon-framework, phalcon-php, phalconphp
- Language: PHP
- Size: 97.7 KB
- Stars: 1
- Watchers: 6
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Baka Database
Baka Database
[](https://scrutinizer-ci.com/g/bakaphp/database/?branch=master)
[](https://scrutinizer-ci.com/g/bakaphp/database/?branch=master)
[](https://scrutinizer-ci.com/g/bakaphp/database/build-status/master)
# Model
The default behavior of the baka model is giving you the normal functions to work with any mc project
- automatic updated_at , created_at times
- soft delete by just calling softDelete() insted of delete()
- toFullArray() instead of toArray() to avoid dynamic fields on your model been removed by phalcon serialization
- Custom Fields Trait and CLI
- Hash Table Traits for dynamic atributes
# Custom Fields Model
One of the things we look for is a table that growth in a vertical way instead of horizontal . We made custom fields to avoid having to go later on in proyect and having to add new fields to the table, with this we can managed them dynamicly and later on add UI for the client to better manage the info
To create a custom fields table from a module you will need to use our CLI
To use you need your model to extend from ModelCustomFields
```php
leads_id = $id;
}
}
```
Thats it now you can use this custom fields model like any other, no other explication is needed they will work like any phalcon normal model
# Hash Tables
Like its name implies, you have a table with key value for any entity you desire. This is usefull when you need to add settings to any tables in your system
```php