Set action manager

@param callable $manager

@throws \DataTable\Exception
@return Action
550174
public function setManager(Closure $manager)
    {
        if (!is_callable($manager)) {
            throw new Exception('Manager must be callable.');
        }

        $this->manager = $manager;

        return $this;
    }
788262
public function setCallable($callableExpression)
    {

        if (strpos("@", $callableExpression) === false) {
            $callableExpression .= "@indexAction";
        }

        list($controllerName, $action) = explode("@", $callableExpression);

        $controller = $this->pimple[$controllerName];

        $callable = array(
            $controller,
            $action
        );

        if (!is_callable($callable)) {

            $message = "The callable you have provided is not callable, if you did not provide a action then ";
            $message .= "indexAction will be called on your given controller";

            throw new \InvalidArgumentException($message);
        }

        $this->callable = $callable;
    }
1239567
public function setActions(Callable $action, string $value = null): ColumnInterface
    {
        $this->setKeyAction();
        $this->actions = $action;
        if ($value !== null) {
            $this->setValue($value);
        }

        return $this;
    }
666071
public function load(ObjectManager $manager)
    {
        $translator = $this->container->get('translator');
        $infoName = $translator->trans('informations', array(), 'platform');

        $desktopHomeTab = new HomeTab();
        $desktopHomeTab->setType('admin_desktop');
        $desktopHomeTab->setName($infoName);
        $manager->persist($desktopHomeTab);

        $desktopHomeTabConfig = new HomeTabConfig();
        $desktopHomeTabConfig->setHomeTab($desktopHomeTab);
        $desktopHomeTabConfig->setType('admin_desktop');
        $desktopHomeTabConfig->setVisible(true);
        $desktopHomeTabConfig->setLocked(false);
        $desktopHomeTabConfig->setTabOrder(1);
        $manager->persist($desktopHomeTabConfig);

        $workspaceHomeTab = new HomeTab();
        $workspaceHomeTab->setType('admin_workspace');
        $workspaceHomeTab->setName($infoName);
        $manager->persist($workspaceHomeTab);

        $workspaceHomeTabConfig = new HomeTabConfig();
        $workspaceHomeTabConfig->setHomeTab($workspaceHomeTab);
        $workspaceHomeTabConfig->setType('admin_workspace');
        $workspaceHomeTabConfig->setVisible(true);
        $workspaceHomeTabConfig->setLocked(false);
        $workspaceHomeTabConfig->setTabOrder(1);
        $manager->persist($workspaceHomeTabConfig);
    }
998935
public function load(ObjectManager $manager)
    {
        /**
         * @var ObjectDirector $configurationDirector
         */
        $configurationDirector = $this->getDirector('configuration');

        /**
         * Parameter.
         */
        $parameter = $configurationDirector
            ->create()
            ->setKey('my_boolean_parameter')
            ->setNamespace('app')
            ->setName('My Fixtures Boolean Parameter')
            ->setValue(true)
            ->setType('boolean');

        $configurationDirector->save($parameter);
    }
222210
public function load(ObjectManager $manager)
    {
        $windowMaker = new HubWindowMaker();
        $windowMaker->setHub($this->getReference('sam-hub'));
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $manager->persist($windowMaker);
        $manager->flush();

        $windowMaker = new HubWindowMaker();
        $windowMaker->setHub($this->getReference('sam-hub'));
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('11:00');
        $windowMaker->setEndTime('13:00');

        $manager->persist($windowMaker);
        $manager->flush();


        $windowMaker = new HubWindowMaker();
        $windowMaker->setHub($this->getReference('nick-hub'));
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $manager->persist($windowMaker);
        $manager->flush();

        $windowMaker = new HubWindowMaker();
        $windowMaker->setHub($this->getReference('nick-hub'));
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('11:00');
        $windowMaker->setEndTime('13:00');

        $manager->persist($windowMaker);
        $manager->flush();


        $windowMaker = new HubWindowMaker();
        $windowMaker->setHub($this->getReference('ramon-hub'));
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $manager->persist($windowMaker);
        $manager->flush();

        $windowMaker = new HubWindowMaker();
        $windowMaker->setHub($this->getReference('ramon-hub'));
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('11:00');
        $windowMaker->setEndTime('13:00');

        $manager->persist($windowMaker);
        $manager->flush();
    }
982437
protected function decorateManager(array $settings = [], EntityManagerInterface $manager)
    {
        if ($decorator = Arr::get($settings, 'decorator', false)) {
            if (!class_exists($decorator)) {
                throw new InvalidArgumentException("EntityManagerDecorator {$decorator} does not exist");
            }

            $manager = new $decorator($manager);
        }

        return $manager;
    }
6030
protected function helper_setup(\tool_log\log\manager $manager) {
        $this->manager = $manager;
        $called = get_called_class();
        $parts = explode('\\', $called);
        if (!isset($parts[0]) || strpos($parts[0], 'logstore_') !== 0) {
            throw new \coding_exception("Store $called doesn't define classes in correct namespaces.");
        }
        $this->component = $parts[0];
        $this->store = str_replace('logstore_', '', $this->store);
    }
862802
protected function getPdo(Manager $manager, $environment)
    {
        /* @var AdapterWrapper $dbAdapter */
        $dbAdapter = $manager->getEnvironment($environment)->getAdapter();

        if ($dbAdapter instanceof PdoAdapter) {
            $pdo = $dbAdapter->getConnection();
        } else {
            $dbAdapter->connect();
            $pdo = $dbAdapter->getAdapter()->getConnection();
        }
        if (!$pdo) {
            $pdo = $dbAdapter->getOption('connection');
        }
        if (!$pdo instanceof PDO) {
            throw new Exception('No PDO database connection found.');
        }

        return $pdo;
    }
1180695
public function setAction($action)
    {
        if (!is_string($action) && !is_callable($action)) {
            throw new \LogicException(sprintf('Route action given "%s" is invalid. String or Callable expected.', gettype($action)));
        }
        $this->action = $action;
        
        return $this;
    }
27309
public function flag($manager, $flag)
    {
        if (!in_array($flag, array(self::FLAG_AVAILABLE, self::FLAG_UNAVAILABLE))) {
            throw new \InvalidArgumentException(
                'Client::flagManager $flag argument must be one of the FLAG_ constants');
        }

        if (!isset($this->managerStatus[$flag][$manager])) {
            $this->managerStatus[$flag][$manager] = $manager;
        }

        $removeFlag = ($flag != self::FLAG_AVAILABLE) ? self::FLAG_AVAILABLE : self::FLAG_UNAVAILABLE;
        if (isset($this->managerStatus[$removeFlag][$manager])) {
            unset($this->managerStatus[$removeFlag][$manager]);
        }
    }
438081
public function load(ObjectManager $manager)
    {
        // resource type attributes : name, listable, navigable, class
        $resourceTypes = array(
            array('file', true),
            array('directory', true),
            array('text', true),
            array('resource_shortcut', false),
            array('activity', true)
        );

        $types[] = array();

        foreach ($resourceTypes as $attributes) {
            $type = new ResourceType();
            $type->setName($attributes[0]);
            $type->setExportable($attributes[1]);
            $manager->persist($type);
            $this->container->get('claroline.manager.mask_manager')->addDefaultPerms($type);
            $types[$attributes[0]] = $type;
        }

        //add special actions.
        $composeDecoder = new MaskDecoder();
        $composeDecoder->setValue(pow(2, 10));
        $composeDecoder->setName('compose');
        $composeDecoder->setResourceType($types['activity']);
        $manager->persist($composeDecoder);

        $activityMenu = new MenuAction();
        $activityMenu->setName('compose');
        $activityMenu->setAsync(false);
        $activityMenu->setIsCustom(true);
        $activityMenu->setValue(pow(2, 10));
        $activityMenu->setResourceType($types['activity']);
        $activityMenu->setIsForm(false);
        $manager->persist($activityMenu);

        $updateFile = new MenuAction();
        $updateFile->setName('update_file');
        $updateFile->setAsync(true);
        $updateFile->setIsCustom(true);
        $updateFile->setIsForm(false);
        $updateFile->setResourceType($types['file']);
        //16 is default for edit
        $updateFile->setValue(16);
        $manager->persist($updateFile);

        $fileAction = new ActivityRuleAction();
        $fileAction->setAction('resource-read');
        $fileAction->setResourceType($types['file']);
        $manager->persist($fileAction);

        $textAction = new ActivityRuleAction();
        $textAction->setAction('resource-read');
        $textAction->setResourceType($types['text']);
        $manager->persist($textAction);

        $badgeAwardAction = new ActivityRuleAction();
        $badgeAwardAction->setAction('badge-awarding');
        $manager->persist($badgeAwardAction);
    }
908557
public function onBeforeAddToManager(Manager $manager)
    {
        /* @var DataObjectScaffolder $owner */
        $owner = $this->owner;
        $memberType = StaticSchema::inst()->typeNameForDataObject(Member::class);
        $instance = $owner->getDataObjectInstance();
        $class = $owner->getDataObjectClass();
        if (!$instance->hasExtension(Versioned::class)) {
            return;
        }
        /* @var ObjectType $rawType */
        $rawType = $owner->scaffold($manager);

        $versionName = $this->createVersionedTypeName($class);
        $coreFieldsFn = $rawType->config['fields'];
        // Create the "version" type for this dataobject. Takes the original fields
        // and augments them with the Versioned_Version specific fields
        $versionType = new ObjectType([
            'name' => $versionName,
            'fields' => function () use ($coreFieldsFn, $manager, $memberType) {
                $coreFields = $coreFieldsFn();
                $versionFields = [
                    'Author' => [
                        'type' => $manager->getType($memberType),
                        'resolve' => function ($obj) {
                            return $obj->Author();
                        }
                    ],
                    'Publisher' => [
                        'type' => $manager->getType($memberType),
                        'resolve' => function ($obj) {
                            return $obj->Publisher();
                        }
                    ],
                    'Published' => [
                        'type' => Type::boolean(),
                        'resolve' => function ($obj) {
                            return $obj->WasPublished;
                        }
                    ],
                    'LiveVersion' => [
                        'type' => Type::boolean(),
                        'resolve' => function ($obj) {
                            return $obj->isLiveVersion();
                        }
                    ],
                    'LatestDraftVersion' => [
                        'type' => Type::boolean(),
                        'resolve' => function ($obj) {
                            return $obj->isLatestDraftVersion();
                        }
                    ],
                ];
                // Remove this recursive madness.
                unset($coreFields['Versions']);

                return array_merge($coreFields, $versionFields);
            }
        ]);

        $manager->addType($versionType, $versionName);

        // With the version type in the manager now, add the versioning fields to the dataobject type
        $owner
            ->addFields(['Version'])
            ->nestedQuery('Versions', new ReadVersions($class, $versionName));
    }
256474
public function manager(RendererManager $manager, Container $container)
    {
        $this->rendererManager = $manager;

        // Prepare Globals
        $this->prepareGlobals($container, $manager);

        return $manager;
    }
1291490
public function manager()
    {
        if (!isset($this->manager)) {
            $this->manager = new Manager($this->client);
        }

        return $this->manager;
    }
1058073
protected function setAddRoute($controller, $action): Controller
    {
        $callTo = Inflector::classify($controller) . '@' . $action;

        $this->routes['get'] = array_merge($this->routes['get'], [
            "/$controller/$action/" => $callTo,
        ]);

        $this->routes['post'] = [
            "/$controller/$action/" => $callTo,
        ];

        return $this;
    }
1221668
public function load(ObjectManager $manager)
    {
        $testClient = new ApiClient();
        $testClient->setName('Test client');
        $testClient->setKey('test_key');
        $testClient->setSecret('test_secret');
        $testClient->setTrusted(true);

        $manager->persist($testClient);
        $manager->flush();
    }