Пример #1
0
 public function generateCode(ContextInterface $context)
 {
     list($type, $resource, $action) = array_slice(explode('.', $context->getName()), -3);
     // all marketplace contexts have this getPartner or getVenture
     // additional info on contexts
     $company = $this->get($context->getPartner() ?: $context->getVenture());
     return [['name' => 'TYPE', 'code' => $this->get($type)], ['name' => 'RESOURCE', 'code' => $this->get($resource)], ['name' => 'ACTION', 'code' => $this->get($action)], ['name' => 'COMPANY', 'code' => $company]];
 }
Пример #2
0
 public function generateCode(ContextInterface $context)
 {
     return new DataWrapper\FragmentCollection([['name' => 'TEST', 'code' => $this->get($context->getName())]]);
 }