atomatis/ofm 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

atomatis/ofm

Composer 安装命令:

composer require atomatis/ofm

包简介

Object file mapper

README 文档

README

Object file manipulator inspired by doctrine/ORM package

Warning. I write this for personal use. Documentation is really poor. If you are interested for use this package, contact me at alexandre.tomatis@gmail.com for get better documentation.

Installation

composer req atomatis/OFM

Usage

Create entity

Example with yaml file

<?php

declare(strict_types=1);

namespace App\Entity;

use Atomatis\OFM as OFM;

#[OFM\Entity(OFM\Entity::TYPE_YAML)]
final class Configuration
{
    #[OFM\Parameter]
    private ?string $foo;

    #[OFM\Parameter]
    private ?array $bar;
    
    ...
    
    // getter/setter
    
    ...

Configuration

// init registry with Entity file path.
$registry = new Registry();
$registry->addFile(Configuration::class, (new RegistryConfiguration())->setPath('my/file/path/configuration.yaml'));
$entityManager = new EntityManager($registry);

Load file

# my/file/path/configuration.yaml
foo: 'hello here'
$configuration = $entityManager->load(Configuration::class);

$configuration->getFoo(); // return 'hello here'
$configuration->getBar(); // return null

Flush file

# my/file/path/configuration.yaml
foo: 'hello here'
$configuration = $entityManager->load(Configuration::class);
$configuration->setFoo('see you later');
$entityManager->flush($configuration);
# my/file/path/configuration.yaml
foo: 'see you later'

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2022-05-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固