承接 ronte-ltd/common-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

ronte-ltd/common-bundle

Composer 安装命令:

composer require ronte-ltd/common-bundle

包简介

The bundle for collecting common libraries and everything else

README 文档

README

This bundle contains some methods for help

Installation

Composer

composer require ronte-ltd/common-bundle

AppKernel.php

new RonteLtd\ElasticBundle\RonteLtdCommonBundle()

Usage

Entity

<?php

namespace AppBundle\Entity;

use RonteLtd\CommonBundle\Entity\AbstractBaseEntity;
use Doctrine\ORM\Mapping as ORM;

/**
 * Entity
 *
 * @ORM\Entity(repositoryClass="AppBundle\Repository\DefaultRepository")
 * @ORM\Table(name="some_entity")
 */
class Entity extends AbstractBaseEntity
{
}

Repository

<?php

namespace AppBundle\Repository;

use RonteLtd\CommonBundle\Repository\AbstractBaseRepository;

class DefaultRepository extends AbstractBaseRepository
{
}

Service

<?php

namespace AppBundle\Service;

use RonteLtd\CommonBundle\Service\AbstractBaseService;

class EntityService extends AbstractBaseService
{
}

For explanation we can use this code to define custom service

services:
    ## Repositories
    app.entity_repository:
        class: AppBundle\Repository\DefaultRepository
        factory: ["@doctrine.orm.entity_manager", getRepository]
        arguments:
            - AppBundle\Entity\Entity

    ## Services
    app.entity_service:
        class: AppBundle\Service\EntityService
        arguments: ["@validator", "@event_dispatcher"]
        calls:
            - [setRepository, ['@app.entity_repository']]

Controller

For quick example

// We are recieving the service with repository
$service = $this->get('app.entity_service');
$entity = new Entity();

// validate
$result = $service->validate($entity)

// save|remove
$service->save($entity);
$service->remove($entity);

// paginate
$service->paginate($query)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-11-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固