ezsystems/ez-matrix-bundle
Composer 安装命令:
composer require ezsystems/ez-matrix-bundle
包简介
EzMatrix FieldType for eZ Publish Platform
关键字:
README 文档
README
Bundle provides ezmatrix field type for eZ Publish Platform 5.x and higher
⛔️ Status DEPRECATED: As of 2.5 there is now bundled a newer version avaiable from eZ with full support, migration, UI editing and more. ⛔️
This bundle can and should be used on earlier versions, but will not recive support for use in 1.x or 2.x UI or full API support, so UI editing is limited to use via legacy bridge/bundle.
Install
From your eZ Publish Platform install root with composer installed:
php -d memory_limit=-1 composer.phar require --prefer-dist ezsystems/ez-matrix-bundle:dev-master
Add the following in your app/AppKernel.php file:
public function registerBundles() { ... $bundles[] = new EzSystems\MatrixBundle\EzSystemsMatrixBundle(); return $bundles; }
How to update content programmatically
Here's an example on how to update the value of a matrix field for a content item. The field has two columns, and we are creating two rows of content:
$repository = $this->getContainer()->get( 'ezpublish.api.repository' ); $contentService = $repository->getContentService(); // This example for setting a current user is valid for 5.x and early versions of 6.x installs // This is deprecated from 6.6, and you should use PermissionResolver::setCurrentUserReference() instead $repository->setCurrentUser( $repository->getUserService()->loadUser( 14 ) ); $contentId = 26926; $newTitle = 'My updated title 2'; try { // create a content draft from the current published version $contentInfo = $contentService->loadContentInfo( $contentId ); $contentDraft = $contentService->createContentDraft( $contentInfo ); // instantiate a content update struct and set the new fields $contentUpdateStruct = $contentService->newContentUpdateStruct(); $contentUpdateStruct->initialLanguageCode = 'eng-US'; // set language for new version $matrixValue = new \EzSystems\MatrixBundle\FieldType\Matrix\Value( array( new \EzSystems\MatrixBundle\FieldType\Matrix\Row( array( 'col1' => 'row1col1', 'col2' => 'row1col2' ) ), new \EzSystems\MatrixBundle\FieldType\Matrix\Row( array( 'col1' => 'row2col2', 'col2' => 'row2col2' ) ), ), array( new \EzSystems\MatrixBundle\FieldType\Matrix\Column( array( 'name' => 'Column 1', 'id' => 'col1', 'num' => 0 ) ), new \EzSystems\MatrixBundle\FieldType\Matrix\Column( array( 'name' => 'Column 2', 'id' => 'col2', 'num' => 1 ) ), ) ); $contentUpdateStruct->setField( 'title', $newTitle ); $contentUpdateStruct->setField( 'matrix', $matrixValue ); // update and publish draft $contentDraft = $contentService->updateContent( $contentDraft->versionInfo, $contentUpdateStruct ); $content = $contentService->publishVersion( $contentDraft->versionInfo ); } catch ( \eZ\Publish\API\Repository\Exceptions\NotFoundException $e ) { $output->writeln( $e->getMessage() ); } catch( \eZ\Publish\API\Repository\Exceptions\ContentFieldValidationException $e ) { $output->writeln( $e->getMessage() ); } catch( \eZ\Publish\API\Repository\Exceptions\ContentValidationException $e ) { $output->writeln( $e->getMessage() ); }
License & Copyright
See LICENSE file.
Contributors
https://github.com/ezcommunity/EzMatrixFieldTypeBundle/graphs/contributors
ezsystems/ez-matrix-bundle 适用场景与选型建议
ezsystems/ez-matrix-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 59.14k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2014 年 09 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「ezpublish」 「ezmatrix」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ezsystems/ez-matrix-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ezsystems/ez-matrix-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ezsystems/ez-matrix-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Novactive eZ 2FA Bundle is an Ibexa bundle that provides two-factor authentication for your Ibexa project
Kaliop eZ-Lorem-Ipsum Bundle
Interactive debug shell for eZ Publish 5+ apps. Uses PsySH.
eZ Platform AdminUI extension
Netgen Enhanced Binary File bundle for eZ Publish
eZ Publish 5 bundle to inject settings from a yml file into the legacy eZ Publish kernel.
统计信息
- 总下载量: 59.14k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2014-09-25