예제 #1
0
 private function fontsPerGroup()
 {
     $this->map->put(1, array(1, 2, 3, 4));
     $this->map->put(2, array(1, 2, 5, 6, 7));
     $this->map->put(3, array(1, 2, 8));
     $this->map->put(4, array(9, 10));
 }
예제 #2
0
 function testPropertyDescriptor()
 {
     $name_d1 = 'd1';
     $name_d2 = 'd2';
     $p = new MockPlugin($this);
     $pi = new TestPluginInfo($p);
     $d1 = new MockPropertyDescriptor($this);
     $d1->setReturnReference('getName', $name_d1);
     $d2 = new MockPropertyDescriptor($this);
     $d2->setReturnReference('getName', $name_d2);
     $d3 = new MockPropertyDescriptor($this);
     $d3->setReturnReference('getName', $name_d1);
     $pi->addPropertyDescriptor($d1);
     $pi->addPropertyDescriptor($d2);
     $pi->addPropertyDescriptor($d3);
     $expected = new Map();
     $expected->put($name_d2, $d2);
     $expected->put($name_d1, $d3);
     $descriptors = $pi->getpropertyDescriptors();
     $this->assertTrue($expected->equals($descriptors));
     $pi->removePropertyDescriptor($d3);
     $descriptors = $pi->getpropertyDescriptors();
     $this->assertFalse($expected->equals($descriptors));
     $this->assertEqual($descriptors->size(), 1);
 }
예제 #3
0
 private function statements()
 {
     $this->statements->put("subarea", array("where" => "this_.theme = :subarea", "join" => "LEFT OUTER JOIN subarea ON subarea.id = this_.theme", "atts" => ", subarea.name AS subareaName"));
     $this->statements->put("area", array("where" => "subarea.id = this_.theme AND area.id = :area AND area.id = subarea.area_id", "join" => "LEFT OUTER JOIN area ON area.id = subarea.area_id", "atts" => ", area.name AS areaName"));
     $this->statements->put("title", array("where" => "this_.title = :title", "join" => "", "atts" => ""));
     $this->statements->put("state", array("where" => "this_.state = :state", "join" => "LEFT OUTER JOIN estados ON this_.state = estados.id", "atts" => ", estados.id AS idState, estados.uf, estados.nome AS nameState"));
     $this->statements->put("type_event", array("where" => "this_.type_event = :type_event", "join" => "", "atts" => ", this_.type_event AS event"));
     $this->statements->put("beginDate", array("where" => "this_.date >= :beginDate", "join" => "", "atts" => ""));
     $this->statements->put("endDate", array("where" => "this_.date <= :endDate", "join" => "", "atts" => ""));
     $this->statements->put("title", array("where" => "MATCH(this_.title) AGAINST(:title IN BOOLEAN MODE)", "join" => "", "atts" => ""));
 }
예제 #4
0
 private function tableOfTypes()
 {
     $this->types->put("IC", new ProvideBMF());
     $this->types->put("KC", new ProvideNewYork());
     $this->types->put("RC", new ProvideLondon());
     $this->types->put("CF", new ProvideArabica());
     $this->types->put("DO", new ProvideDolarCom());
     $this->types->put("EU", new ProvideEuroCom());
     $this->types->put("WI", new ProvideIBovespa());
 }
예제 #5
0
 public function addHook($hook, $callback = null, $recallHook = false)
 {
     if ($this->hooks->containsKey($hook)) {
         throw new RuntimeException('A plugin cannot listen to the same hook several time. Please check ' . $hook);
     }
     $value = array();
     $value['hook'] = $hook;
     $value['callback'] = $callback ? $callback : $hook;
     $value['recallHook'] = $recallHook;
     $this->hooks->put($hook, $value);
 }
예제 #6
0
 /**
  * {@inheritdoc}
  */
 public function build(SetInterface $identities, ServerRequestInterface $request, HttpResource $definition, SpecificationInterface $specification = null, Range $range = null) : MapInterface
 {
     $map = new Map('string', HeaderInterface::class);
     if ($identities->size() === 0) {
         return $map;
     }
     $path = $request->url()->path();
     return $map->put('Link', new Link($identities->reduce(new Set(HeaderValueInterface::class), function (Set $carry, IdentityInterface $identity) use($path) : Set {
         return $carry->add(new LinkValue(Url::fromString(rtrim((string) $path, '/') . '/' . $identity), 'resource', new Map('string', ParameterInterface::class)));
     })));
 }
 private function setFiletypeAllowance()
 {
     $this->filetypeAllowed = new HashMap();
     $this->filetypeAllowed->put("application/pdf", true);
     $this->filetypeAllowed->put("application/text", false);
 }
예제 #8
0
 public function addDestiny(Country $destiny)
 {
     //$this->destiny->put($destiny->name(), $destiny->id());
     $this->destiny->put($destiny->name(), $destiny);
 }
예제 #9
0
 private function types()
 {
     $this->types->put("CFDUR5 SMG", "Bica Fina MGerais");
     $this->types->put("CFDUR6 CER", "Bica Dura T.6 Cerrado-MG");
     $this->types->put("CFDUR6 GAR", "Bica Dura T.6 Garça-SP");
     $this->types->put("CFDESP BAH", "Despolpado VConquista-BA");
     $this->types->put("CFDUR6 MOG", "Bica Dura T.6 Mogiana-SP");
     $this->types->put("CFDUR6 PIN", "Bica Dura T.6 Pinhal-ES");
     $this->types->put("CFDUR6 SMG", "Bica Dura T.6 Sul Minas");
     $this->types->put("CFDUR6 ZOM", "Bica Dura T.6/7 ZMata-MG");
     $this->types->put("CFDUR7 BAH", "Bica Dura T.6/7 VConquista-BA");
     $this->types->put("CFDUR7 PRN", "Bica Dura T.6/7 Norte-PR");
     $this->types->put("CFDURI ZOM", "Bica Dura/Riada ZMata-MG");
 }
예제 #10
0
 private function groupIntoMap(Map &$map, $auxList, &$i)
 {
     if ($auxList != null) {
         $map->put($i++, $auxList);
     }
 }
예제 #11
0
 /**
  * @param Formats $formats
  * @param ServerRequestInterface $request
  *
  * @return MapInterface<string, HeaderInterface>
  */
 private function buildHeaderFrom(Formats $formats, ServerRequestInterface $request) : MapInterface
 {
     $map = new Map('string', HeaderInterface::class);
     $format = $formats->matching((string) $request->headers()->get('Accept')->values()->join(', '));
     return $map->put('Content-Type', new ContentType(new ContentTypeValue($format->preferredMediaType()->topLevel(), $format->preferredMediaType()->subType(), new Map('string', ParameterInterface::class))));
 }
예제 #12
0
 /**
  * {@inheritdoc}
  */
 public function build(IdentityInterface $identity, ServerRequestInterface $request, HttpResource $definition, HttpResourceInterface $resource) : MapInterface
 {
     $map = new Map('string', HeaderInterface::class);
     return $map->put('Location', new Location(new LocationValue(Url::fromString(rtrim((string) $request->url()->path(), '/') . '/' . $identity))));
 }
예제 #13
0
 public function setValues(array $values)
 {
     $this->values->put($this->numberOfRows++, $values);
 }