@param LoadingContext $context
@param ParentChildMap $map

@return void
498653
public function load(LoadingContext $context, ParentChildMap $map)
    {
        /** @var Row[] $parentRows */
        $parentRows = [];
        /** @var ParentChildItem[] $items */
        $items = [];

        $requiredColumnLookup = $this->getRequiredColumnLookup();

        foreach ($map->getItems() as $key => $item) {
            $parentRow = $item->getParent();

            if ($this->objectIssetColumnName) {
                $objectIssetValue = $parentRow->getColumn($this->objectIssetColumnName);
                if ($this->isWithinValueObject && $objectIssetValue === null) {
                    continue;
                } elseif (!$this->isWithinValueObject && !$objectIssetValue) {
                    continue;
                }
            } else {
                // In case this relation was loaded via a LEFT JOIN the columns may be null
                // even if they are not nullable hence we must only load the object if all the non nullable columns
                // does not contain a null value.
                foreach ($this->parentColumnsToLoad as $requiredColumn) {
                    if (isset($requiredColumnLookup[$requiredColumn]) && $parentRow->getColumn($requiredColumn) === null) {
                        continue 2;
                    }
                }
            }

            $parentRows[$key] = $parentRow;
            $items[$key]      = $item;
        }

        $objects = $this->mapper->loadAll($context, $parentRows);

        foreach ($objects as $key => $object) {
            $items[$key]->setChild($object);
        }
    }
503030
protected function getDataFromMap(ParentChildMap $map) : array
    {
        /** @var Row[] $parentRows */
        $parentRows = [];
        /** @var object[] $children */
        $children = [];

        foreach ($map->getItems() as $key => $item) {
            if ($item->getChild()) {
                $parentRows[$key] = $item->getParent();
                $children[$key]   = $item->getChild();
            }
        }

        return array($parentRows, $children);
    }
18330
public static function load($context = '')
    {
        if (empty($context)) {
            $context = self::$defaultContext;
        }
        if ($context[0] !== '\\') {
            // Short context name (must be formatted into class name).
            $context = self::$contextPrefix . $context;
        }
        if (! class_exists($context)) {
            throw @new LoaderException(
                'Specified context ("' . $context . '") does not exist.',
                $context
            );
        }
        self::$loadedContext = $context;
        self::$KEYWORDS = $context::$KEYWORDS;
    }
518880
private function fetchChildrenResources(array &$data, Context $context)
    {
        $resourceName = $this->config->getResourceName();
        //$resourceNamePlural = $this->config->getResourceName(true);

        $resource = $context->getResource($resourceName);

        $childrenConfigurations = $this->get('ekyna_admin.pool_registry')->getChildren($this->config);
        foreach ($childrenConfigurations as $childConfig) {
            $childResourceName = $childConfig->getResourceName(true);
            if (!array_key_exists($childResourceName, $data)) {

                $customizeQb = null;

                /** @var \Doctrine\ORM\Mapping\ClassMetadataInfo $metadata */
                $metadata = $this->get($childConfig->getServiceKey('metadata'));

                // Look for many to one
                if ($metadata->hasAssociation($resourceName)) {
                    $mapping = $metadata->getAssociationMapping($resourceName);
                    if ($mapping['type'] === ClassMetadataInfo::MANY_TO_ONE) {
                        $customizeQb = function (QueryBuilder $qb, $alias) use ($resourceName, $resource) {
                            $qb
                                ->andWhere(sprintf($alias . '.%s = :resource', $resourceName))
                                ->setParameter('resource', $resource);
                        };
                    } else {
                        throw new \RuntimeException(sprintf('"%s" is not a supported association type.', $childResourceName));
                    }
                // Look for many to many
                } /*elseif ($metadata->hasAssociation($resourceNamePlural)) {
                    $mapping = $metadata->getAssociationMapping($resourceNamePlural);
                    if ($mapping['type'] === ClassMetadataInfo::MANY_TO_MANY) {
                        $customizeQb = function (QueryBuilder $qb, $alias) use ($resourceNamePlural, $resource) {
                            $qb
                                ->join($alias.'.'.$resourceNamePlural, 'parent')
                                ->where('parent.id = :resource')
                                ->setParameter('resource', $resource);
                        };
                    } else {
                        throw new \RuntimeException(sprintf('"%s" is not a supported association type.', $childResourceName));
                    }
                }*/ else {
                    throw new \RuntimeException(sprintf('Association "%s" not found.', $childResourceName));
                }

                $table = $this->getTableFactory()
                    ->createBuilder($childConfig->getTableType(), [
                        'name' => $childConfig->getId(),
                        'customize_qb' => $customizeQb,
                    ])
                    ->getTable($context->getRequest());

                //$table->getConfig()->setCustomizeQb($customizeQb);

                $data[$childResourceName] = $table->createView();
            }
        }
    }
1106958
private void registerLocalChildBinding(Key<?> key, GinjectorBindings binding) {
    boundLocallyInChildren.put(key, binding);
    if (parent != null) {
      parent.registerLocalChildBinding(key, binding);
    }
  }
1033091
protected function createChildContext(array $parentContext, $attribute/*, string $format = null */)
    {
        if (\func_num_args() >= 3) {
            $format = \func_get_arg(2);
        } else {
            // will be deprecated in version 4
            $format = null;
        }

        $context = parent::createChildContext($parentContext, $attribute, $format);
        // format is already included in the cache_key of the parent.
        $context['cache_key'] = $this->getCacheKey($format, $context);

        return $context;
    }
131017
@Override
	public synchronized void removeContext(Context context) {

        if( log.isDebugEnabled() )
            log.debug("Removing context[" + context.getPath() + "]");

        boolean isContextExists = isContextExists(context);
        if(!isContextExists)
        	return;
        
        // Remove this Context from the associated Host
        if( log.isDebugEnabled() )
            log.debug(" Removing this Context");
        context.getParent().removeChild(context);

    }
144845
public function initializeContext(Context $context)
    {
        if ($context instanceof ResourceContext) {
            $reflector = new ReflectionClass(get_class($context));

            if ($this->builder->getLoader() instanceof FileResourceLoader) {
                if ($this->builder->getLoader()->getBasePath() == null) {
                    $this->builder->getLoader()->setBasePath(dirname($reflector->getFileName()));
                }
            }

            if ($context->getResourceFactory()) {
                $this->builder->setFactory($context->getResourceFactory());
            }

            $context->setResourceBuilder($this->builder);
        }
    }
889864
public function onEndMap(Map $map)
    {
        $jbmap = $this->jukeboxService->getFirst();
        if ($jbmap) {
            try {
                $this->factory->getConnection()->chooseNextMap($jbmap->getMap()->fileName);
                $this->jukeboxService->removeMap($jbmap->getMap(), null, true);
            } catch (\Exception $e) {
                $this->jukeboxService->removeMap($jbmap->getMap(), null, true);
            }
        }
    }
1372862
public static Map getOrCreateChildMap(Map parent, String key) {
        Object o = parent.get(key);
        if(o instanceof Map) {
            return (Map)o;
        }
        return new LinkedHashMap();
    }
223707
public function initialize(AgaviContext $context, array $parameters = array())
	{
		parent::initialize($context, $parameters);

		$this->plugin_dir = $this->getParameter('plugin_dir', $this->plugin_dir);
	}
1102652
private void processCustomIdNodeMapping(final Map<String, TreeItemIdNode> map, final TreeItemIdNode node) {
		String itemId = node.getItemId();
		if (!Util.empty(itemId)) {
			map.put(itemId, node);
		}

		for (TreeItemIdNode childItem : node.getChildren()) {
			processCustomIdNodeMapping(map, childItem);
		}
	}
909764
protected function invokePluginsOnRender($template, array $context)
    {
        foreach ($this->plugins as $plugin) {
            $plugin->onRender($this, $template, $context);
        }
    }
1065550
public function postProcessContentObjectInitialization(ContentObjectRenderer &$parentObject)
    {
        if (!empty($parentObject->currentRecord)) {
            list($table) = explode(':', $parentObject->currentRecord);

            if (!empty($table) && $table != 'pages') {
                $this->findFrontendGroups($parentObject->data, $table);
            }
        }
    }
32614
function (idMap) {
                if (this.idMap == idMap) {
                    // already the same id map (especially useful if both are null)
                    return;
                }
                // set child idMap to its parent value
                this.idMap = idMap;
                var id = this.id;
                if (id && idMap) {
                    if (idMap[id]) {
                        this.$logError(this.SECTION_ALREADY_EXISTS, [this.tplCtxt.tplClasspath, id]);
                    } else {
                        idMap[id] = this;
                    }
                }
                var content = this._content;
                var contentSize = content.length;
                // add the ids found in this section to the parent map:
                // and recursively call __updateIdMap
                for (var i = 0; i < contentSize; i++) {
                    var elt = content[i];
                    if (elt._type == TYPE_SECTION) {
                        elt.__updateIdMap(idMap);
                    } else {
                        id = elt.id;
                        if (id && idMap) {
                            if (idMap[id]) {
                                this.$logError(this.WIDGET_ID_NOT_UNIQUE, [this.tplCtxt.tplClasspath, id,
                                        elt.behavior.$class]);
                            } else {
                                idMap[id] = elt;
                            }
                        }
                    }
                }
            }
1009676
protected function insertRelated(PersistenceContext $context, ParentChildMap $map)
    {
        /** @var Row[] $parents */
        $parents = [];
        /** @var array $children */
        $children = [];

        foreach ($map->getItems() as $key => $item) {
            $parents[$key]  = $item->getParent();
            $children[$key] = $item->getChild();
        }

        $primaryKey = $this->mapper->getPrimaryTable()->getPrimaryKeyColumnName();
        $rows       = $this->reference->syncRelated($context, [], $children);

        foreach ($rows as $key => $row) {
            $parent = $parents[$key];

            if ($row->hasColumn($primaryKey)) {
                $this->setForeignKey([$parent], $this->foreignKeyToRelated, $row->getColumn($primaryKey));
            } else {
                $row->onInsertPrimaryKey(function ($id) use ($parent) {
                    $this->setForeignKey([$parent], $this->foreignKeyToRelated, $id);
                });
            }
        }
    }
714292
public function onBeginMap(Map $map)
    {
        $this->widget->setDedimaniaRecord(null);
        $this->widget->setLocalRecord(null);
        $this->widget->update($this->allPlayers);
    }