PHPackages                             activecollab/databasestructure - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. activecollab/databasestructure

ActiveLibrary[Database &amp; ORM](/categories/database)

activecollab/databasestructure
==============================

Define database structure in PHP and let the library generate object classes and tables

3.2.4(2y ago)116.7k2[1 PRs](https://github.com/activecollab/databasestructure/pulls)1MITPHPPHP &gt;=8.0

Since Nov 11Pushed 10mo ago5 watchersCompare

[ Source](https://github.com/activecollab/databasestructure)[ Packagist](https://packagist.org/packages/activecollab/databasestructure)[ Docs](https://labs.activecollab.com)[ RSS](/packages/activecollab-databasestructure/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (42)Used By (1)

DatabaseStructure Library
=========================

[](#databasestructure-library)

[![Build Status](https://camo.githubusercontent.com/644325e8ba2561bb5bee462c518deae62f83c0f790b9eb2df1a443eb0fcb51eb/68747470733a2f2f7472617669732d63692e6f72672f616374697665636f6c6c61622f64617461626173657374727563747572652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/activecollab/databasestructure)

Version 1.0 To Do
-----------------

[](#version-10-to-do)

- Get code coverage over 90%,
- Add `serialize` method to fields, so they are automatically added to the serialization list when they are added to a type,
- Prefix all base classes with `Base`,
- Sufix all managers and collections with `Manager` and `Collection` respectively,
- Check for possible collisions between field and attribute that are added by associations,
- Add `release` and `clear` methods to Has Many, and Has Many Via associations,
- Add `ChildInterface`, and make sure that `ParentField` adds it to models that include it,
- Associations should automatically add connection fields to the list of fields to be serialized,
- Association cascading options and tests,

Fields
------

[](#fields)

Boolean fields with names that start with `is_`, `has_`, `had_`, `was_`, `were_` and `have_` also get a short getter. For example, if field name is `is_awesome`, builder will product two getters: `getIsAwesome()` and `isAwesome()`.

### Password Field

[](#password-field)

Password field is field meant for storing password hashes. By default, it sets `password` as field name. It is similar to `StringField` (uses `VARCHAR` columns), but it can't have default value (doh!), and it does not have methods for easy indexing (you can still add an index by yourself, if you wish).

```
