/** * @param int $index * * @return $this */ public function setActive($index) { if (null !== ($active = getArrayElement($index, $this->registrar->getAttendantCollection()))) { $this->active = $active; return true; } return false; }
public function testIsArrayNotEmpty() { $a = [1, 2, 3]; static::assertTrue(isIterable($a)); static::assertFalse(isIterableEmpty($a)); static::assertTrue(isIterableNotEmpty($a)); static::assertEquals(3, countableSize($a)); static::assertEquals(1, getArrayElement(0, $a)); }
/** * @param string $what * @param mixed[] $entry * @param Route $route */ protected function assignRouteValue($what, array $entry, Route $route) { if ($value = getArrayElement('route' . ucfirst($what), $entry)) { $method = 'set' . ucfirst($what); $route->{$method}($value); } }
return $defaultValue; } } $idfInputs = getPost('idf', array()); //idf inputs, used for idf generator $model = getArrayElement($idfInputs, 'building_type', null); //model -> super market, apartment, etc. $numFloors = getArrayElement($idfInputs, 'number_of_floors', null); //number of the the building has $sqrFootage = getPost('size', null); //the amount of square footage the building contains $condition = getArrayElement($idfInputs, 'building_age', null); //condition of the building -> new, recent, old $width = getArrayElement($idfInputs, 'width1', null); //the width of the building $length = getArrayElement($idfInputs, 'length1', null); //the length of the building $numResidents = getPost('numRes', null); //the max number of residents that occupy the building $schedule = getPost('schedule', null); //schedule of the building's usage $climate = getPost('climateZone', null); //the climate zone which the building is located $weatherFile = getPost('weatherFile', null); //the name of the weather file autotune should use $location = getPost('location', null); //the "city, state" which the building is located $eFile = getFile('energyFile', false); //user's file containing the energy usage $energyUsages = getPost('energyUsage', null); //the amount of energy used in a particular month