{"id":17986139,"url":"https://github.com/jimwins/titi","last_synced_at":"2025-03-25T20:34:27.976Z","repository":{"id":56999161,"uuid":"264748642","full_name":"jimwins/titi","owner":"jimwins","description":"A lightweight nearly-zero-configuration object-relational mapper and fluent query builder for PHP, plus a lightweight ActiveRecord implementation","archived":false,"fork":false,"pushed_at":"2024-02-20T21:29:21.000Z","size":1011,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-09-30T06:57:42.763Z","etag":null,"topics":["activerecord","orm","pdo","php","php-library","sql"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jimwins.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-05-17T20:13:57.000Z","updated_at":"2022-02-23T20:01:48.000Z","dependencies_parsed_at":"2024-02-20T21:57:04.829Z","dependency_job_id":"ae3ac956-8ede-478c-b775-a3d68f57068f","html_url":"https://github.com/jimwins/titi","commit_stats":{"total_commits":614,"total_committers":69,"mean_commits":8.898550724637682,"dds":0.6856677524429968,"last_synced_commit":"3adb19d22e2a5b1ae221060c428a092a3c08b018"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimwins%2Ftiti","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimwins%2Ftiti/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimwins%2Ftiti/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimwins%2Ftiti/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimwins","download_url":"https://codeload.github.com/jimwins/titi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222091214,"owners_count":16929556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["activerecord","orm","pdo","php","php-library","sql"],"created_at":"2024-10-29T18:28:49.158Z","updated_at":"2024-10-29T18:28:49.829Z","avatar_url":"https://github.com/jimwins.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Titi\n====\n\n[![Build Status](https://app.travis-ci.com/jimwins/titi.svg?branch=main)](https://app.travis-ci.com/github/jimwins/titi)\n\nTiti is a lightweight nearly-zero-configuration object-relational mapper and\nfluent query builder for PHP, plus a lightweight ActiveRecord implementation.\n\nTiti was forked from [Idiorm and Paris](http://j4mie.github.io/idiormandparis/)\n(combined into a single repo).\n\n---\n\nTested on PHP 8.1.16 and MySQL 8.0.32 - may work on earlier versions with PDO\nand the correct database drivers.\n\nReleased under a [BSD license](http://en.wikipedia.org/wiki/BSD_licenses).\n\nFeatures\n--------\n\n* Makes simple queries and simple CRUD operations completely painless.\n* Gets out of the way when more complex SQL is required.\n* Built on top of [PDO](http://php.net/pdo).\n* Uses [prepared statements](http://php.net/manual/en/pdo.prepared-statements.php) throughout to protect against [SQL injection](http://en.wikipedia.org/wiki/SQL_injection) attacks.\n* Requires no model classes, no XML configuration and no code generation: works out of the box, given only a connection string.\n* Consists of one main class called `ORM`. Additional classes are prefixed with `Titi`. Minimal global namespace pollution.\n* Database agnostic. Currently supports SQLite, MySQL, Firebird and PostgreSQL. May support others, please give it a try!\n* Supports collections of models with method chaining to filter or apply actions to multiple results at once.\n* Multiple connections supported\n* PSR-1 compliant methods (any method can be called in camelCase instead of underscores eg. `find_many()` becomes `findMany()`) - you'll need PHP 5.3+\n\nDocumentation\n-------------\n\nThe documentation is hosted on Read the Docs: [titi.rtfd.io](https://titi.readthedocs.io/).\n\n### Building the Docs ###\n\nYou will need to install [Sphinx](http://sphinx-doc.org/) and then in the docs folder run:\n\n    make html\n\nThe documentation will now be in docs/_build/html/index.html\n\nLet's See Some Code\n-------------------\n\n```php\nrequire 'vendor/autoload.php';\n\nuse \\Titi\\ORM;\nuse \\Titi\\Model;\n\n$user = ORM::for_table('user')\n    -\u003ewhere_equal('username', 'j4mie')\n    -\u003efind_one();\n\n$user-\u003efirst_name = 'Jamie';\n$user-\u003esave();\n\n$tweets = ORM::for_table('tweet')\n    -\u003eselect('tweet.*')\n    -\u003ejoin('user', array(\n        'user.id', '=', 'tweet.user_id'\n    ))\n    -\u003ewhere_equal('user.username', 'j4mie')\n    -\u003efind_many();\n\nforeach ($tweets as $tweet) {\n    echo $tweet-\u003etext;\n}\n\n/* ActiveRecord model */\nclass User extends Model {\n    public function tweets() {\n        return $this-\u003ehas_many('Tweet');\n    }\n}\n\nclass Tweet extends Model {}\n\n$user = Model::factory('User')\n    -\u003ewhere_equal('username', 'j4mie')\n    -\u003efind_one();\n$user-\u003efirst_name = 'Jamie';\n$user-\u003esave();\n\n$tweets = $user-\u003etweets()-\u003efind_many();\nforeach ($tweets as $tweet) {\n    echo $tweet-\u003etext;\n}\n```\n\nTests\n-----\n\nTests are written with PHPUnit and be run through composer\n\n    composer test\n\nTo see the test progress and results:\n\n    composer -v test\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimwins%2Ftiti","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimwins%2Ftiti","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimwins%2Ftiti/lists"}