$modx->log(modX::LOG_LEVEL_INFO,'Packaging in menu...'); $menu = include $sources['data'].'transport.menu.php'; if (empty($menu)) $modx->log(modX::LOG_LEVEL_ERROR,'Could not package in menu.'); $vehicle= $builder->createVehicle($menu,array ( xPDOTransport::PRESERVE_KEYS => true, xPDOTransport::UPDATE_OBJECT => true, xPDOTransport::UNIQUE_KEY => 'text', xPDOTransport::RELATED_OBJECTS => true, xPDOTransport::RELATED_OBJECT_ATTRIBUTES => array ( 'Action' => array ( xPDOTransport::PRESERVE_KEYS => false, xPDOTransport::UPDATE_OBJECT => true, xPDOTransport::UNIQUE_KEY => array ('namespace','controller'), ), ), ));
<?php $action= $modx->newObject('modAction'); $action->fromArray(array( 'id' => 1, 'namespace' => 'doodles', 'parent' => 0, 'controller' => 'index', 'haslayout' => true, 'lang_topics' => 'doodles:default', 'assets' => '', ),'',true,true); $menu= $modx->newObject('modMenu'); $menu->fromArray(array( 'text' => 'doodles', 'parent' => 'components', 'description' => 'doodles.desc', 'icon' => 'images/icons/plugin.gif', 'menuindex' => 0, 'params' => '', 'handler' => '', ),'',true,true); $menu->addOne($action); unset($menus); return $menu;
This question has been answered by theuros. See the first response.
<?php $menu= $modx->newObject('modMenu'); $menu->fromArray(array( 'text' => 'doodles', 'parent' => 'components', 'description' => 'doodles.desc', 'icon' => 'images/icons/plugin.gif', 'menuindex' => 0, 'params' => '', 'handler' => '', 'namespace' => 'doodles', 'action' => 'index', ),'',true,true); unset($menus); return $menu;
Console running... Attempting to install package with signature: doodles-1.0-beta4 Package found...now preparing to install. Grabbing package workspace... PHP notice: Undefined offset: 2 Workspace environment initiated, now installing package... Created table `modx_doodles` SQL: CREATE TABLE `modx_doodles` (`id` INTEGER unsigned NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL DEFAULT '', `description` TEXT NOT NULL, `createdon` DATETIME NULL, `createdby` INT(10) unsigned NOT NULL DEFAULT '0', `editedon` DATETIME NULL, `editedby` INT(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`)) ENGINE=MyISAM Successfully installed package doodles-1.0-beta4 PHP notice: Undefined offset: 2
$arrayName[2];
$modx->log(modX::LOG_LEVEL_INFO, 'Made it to here');