本文整理汇总了PHP中Map::put方法的典型用法代码示例。如果您正苦于以下问题:PHP Map::put方法的具体用法?PHP Map::put怎么用?PHP Map::put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map::put方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fontsPerGroup
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: testPropertyDescriptor
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: statements
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: tableOfTypes
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: addHook
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: build
/**
* {@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)));
})));
}
示例7: setFiletypeAllowance
private function setFiletypeAllowance()
{
$this->filetypeAllowed = new HashMap();
$this->filetypeAllowed->put("application/pdf", true);
$this->filetypeAllowed->put("application/text", false);
}
示例8: addDestiny
public function addDestiny(Country $destiny)
{
//$this->destiny->put($destiny->name(), $destiny->id());
$this->destiny->put($destiny->name(), $destiny);
}
示例9: types
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: groupIntoMap
private function groupIntoMap(Map &$map, $auxList, &$i)
{
if ($auxList != null) {
$map->put($i++, $auxList);
}
}
示例11: buildHeaderFrom
/**
* @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: build
/**
* {@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: setValues
public function setValues(array $values)
{
$this->values->put($this->numberOfRows++, $values);
}