bleicker/nodes 问题修复 & 功能扩展

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

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

bleicker/nodes

最新稳定版本:0.15.8

Composer 安装命令:

composer require bleicker/nodes

包简介

README 文档

README

Usage

Introduce your Node implementation

MyNode.yml:

MyNode:
  type: entity

MyNode.php:

class myNode extends AbstractContentNode {

}

Bootstap an usage of Service

ExampleApp.php

use Bleicker\ObjectManager\ObjectManager;
use Bleicker\Persistence\EntityManager;
use Bleicker\Persistence\EntityManagerInterface;
use Bleicker\Registry\Registry;
use Doctrine\ORM\Tools\Setup;

// Register schemas of this node package
Registry::set('doctrine.schema.paths.nodes', __DIR__ . "/vendor/bleicker/nodes/src/Schema/Persistence");

// Register schemas of you app
Registry::set('doctrine.schema.paths.nodes-functional', __DIR__ . "/Schema/Persistence");

// Register DB Connection
Registry::set('DbConnection', ['url' => 'mysql://john:doe@localhost/yourdb']);

// Register the PersistenceManagerInterface
ObjectManager::register(EntityManagerInterface::class, function () {
	return EntityManager::create(
		Registry::get('DbConnection'),
		Setup::createYAMLMetadataConfiguration(Registry::get('doctrine.schema.paths'))
	);
});

/** @var EntityManagerInterface $entityManager */
$entityManager = ObjectManager::get(EntityManagerInterface::class);

$node = new Page();
$node1 = new Content();
$node2 = new Content();
$node3 = new Content();

$node->addChild($node1)->addChild($node2)->addChildAfter($node3, $node1);

$entityManager->persist($node);
$entityManager->flush();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-04-28