zabidok/php-onerecord-entities
Composer 安装命令:
composer require zabidok/php-onerecord-entities
包简介
PHP ONE Record entities
README 文档
README
🚀 Overview
This project provides an open-source implementation of Cargo (123 entities) and Core Lists (45 entities) from the IATA OneRecord standard. It is built with Doctrine ORM, making it easy to integrate with MySQL and PostgreSQL databases.
🛠 Features
- ✅ Complete Entity Set – Covers all Cargo and Core Lists models from OneRecord.
- ✅ Doctrine ORM Compatibility – Auto-generates tables in relational databases.
- ✅ MySQL & PostgreSQL Support – Works with major SQL databases.
- ✅ Open-source & Community-driven – Contributions welcome!
🔧 Installation
1️⃣ Install via composer
composer require zabidok/php-onerecord-entities
1️⃣ OR Clone Repository
git clone https://github.com/zabidok/php-onerecord-entities.git
cd https://github.com/zabidok/php-onerecord-entities
2️⃣ Install Dependencies
Ensure you have PHP 8+, Composer, and Doctrine installed.
composer install
3️⃣ Configure Database
Create a .env.local file and update the database settings:
DATABASE_URL="mysql://user:password@127.0.0.1:3306/onerecord_db"
Or for PostgreSQL:
DATABASE_URL="pgsql://user:password@127.0.0.1:5432/onerecord_db"
4️⃣ Run Database Migrations
php bin/console doctrine:schema:update --force
5️⃣ Start Using the Entities!
You can now use the Cargo and Core Lists entities in your Symfony application.
📌 Example Usage
Here’s how you can create and persist a Piece entity:
$entityManager = $this->getDoctrine()->getManager(); $piece = new Piece(); $piece->setUpid('example-upid'); $piece->setGoodsDescription('Test cargo'); $entityManager->persist($piece); $entityManager->flush();
🤝 Contributing
We welcome contributions! To contribute:
- Fork the repository.
- Create a new branch (
feature-branch-name). - Submit a pull request.
📝 License
This project is open-source and available under the MIT License.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-25