Adds an Entry to a Section of the List.
@access		public
@param		mixed		$entry			Entry to add
@param		string		$section		Section to add in
@return		void
10833
public function addEntry( $entry, $section )
	{
		if( isset( $this->list[$section] ) && is_array( $this->list[$section] ) && in_array( $entry, $this->list[$section] ) )
			throw new InvalidArgumentException( 'Entry "'.$entry.'" is already in Section "'.$section.'".' );
		$this->list[$section][] = $entry;
	}
434103
public function getSectionOfEntry( $entry )
	{
		foreach( $this->getSections() as $section )
			if( in_array( $entry, $this->list[$section] ) )
				return $section;
		throw new InvalidArgumentException( 'Entry "'.$entry.'" not found in any Section.' );
	}
536241
private function storeSection($section, $content)
    {
        if (!isset($this->scope->sections[$section])) {
            $this->scope->sections[$section] = $content;
        }
    }
1204811
public function getEntry( $index, $section )
	{
		if( !isset( $this->list[$section][$index] ) )
			throw new InvalidArgumentException( 'No Entry with Index '.$index.' in Section "'.$section.'" found.' );
		return $this->list[$section][$index];
	}
672451
public function add($entry)
    {
        $this->log[] = $entry;
        while (count($this->log) > $this->size) {
            array_shift($this->log);
        }
    }
956666
public static function add( $section_id, array $args ) {
		$section = static::_section( $section_id, $args );
		static::$sections[ $section->get_id() ] = $section;
		return $section;
	}
105336
public static void addEntry(File zip, ZipEntrySource entry, File destZip) {
    addEntries(zip, new ZipEntrySource[] { entry }, destZip);
  }
250321
public function startSection($section, $default = null)
    {
        $context = $this->_context;

        if ($default === null) {
            ob_start();
            ob_implicit_flush(false);
            $context->stack[] = $section;
        } else {
            $context->sections[$section] = $default;
        }
    }
200426
public final void addEntries(Iterator<Entry<?>> entries) {
        if (entries != null) {
            while (entries.hasNext()) {
                addEntry(entries.next());
            }
        }
    }
171908
public function addEntry(LogEntry $entry)
	{
		// Convert the date.
		$entry->date = $entry->date->format($this->db->getDateFormat());

		$this->db->insertObject($this->table, $entry);
	}
51476
public final void addBin(@NotNull final BinClasspathEntry entry) {
        Contract.requireArgNotNull("entry", entry);
        if (binList == null) {
            binList = new ArrayList<>();
        }
        binList.add(entry);
    }
662943
public function setValues($values, $section = 0)
    {
        foreach ($values as $name => $val) {
            if (is_array($val)) {
                // let's ignore key values, we don't want them
                $i = 0;
                foreach ($val as $arval) {
                    $this->setValue($name, $arval, $section, $i++);
                }
            } else {
                $this->setValue($name, $val, $section);
            }
        }
    }
1338273
public function addEntry(ExtEntry $entry)
    {
        if (!$this->getEntries()->contains($entry)) {
            $this->getEntries()->add($entry);
        }

        return $this;
    }
979140
public function add($section, $config = array())
    {
        if (! isset($this->config[$section])) {
            $this->config[$section] = array();
        }

        $this->config[$section] = array_merge($this->config[$section], $config);
    }
41191
def add_section(self, section):
        
        # check if section already exists
        if not self.config.has_section(section):
            self.config.add_section(section)
            # return updated sections
            return (True, self.config.sections())
        return (False, 'Section: ' + section + ' already exists')
639849
public function addLogEntry(\JLogEntry $entry)
    {
        if ($this->logger !== null) {
            $level = $entry->priority;
            $message = $entry->message;
            $context = [];

            switch (true) {
                case $level <= Log::EMERGENCY:
                    $this->logger->emergency($message, $context);
                    break;
                case $level <= Log::ALERT:
                    $this->logger->alert($message, $context);
                    break;
                case $level <= Log::CRITICAL:
                    $this->logger->critical($message, $context);
                    break;
                case $level <= Log::ERROR:
                    $this->logger->error($message, $context);
                    break;
                case $level <= Log::WARNING:
                    $this->logger->warning($message, $context);
                    break;
                case $level <= Log::NOTICE:
                    $this->logger->notice($message, $context);
                    break;
                case $level <= Log::INFO:
                    $this->logger->info($message, $context);
                    break;
                case $level <= Log::DEBUG:
                default:
                    $this->logger->debug($message, $context);
                    break;
            }
        }
    }
562684
private function _populateEntryModel(Section $section, SectionSettings $sectionSettings, Request $request): Entry
    {
        // Create and populate the entry
        $entry = new Entry([
            'sectionId' => $section->id,
            'authorId' => Db::idByUid('{{%elements}}', $sectionSettings->authorUid),
            'siteId' => $request->getBodyParam('siteId'),
            'typeId' => $request->getBodyParam('typeId') ?? $section->getEntryTypes()[0]->id,
            'title' => $request->getBodyParam('title'),
            'slug' => $request->getBodyParam('slug'),
            'enabled' => (bool)$sectionSettings->enabledByDefault,
            'enabledForSite' => (bool)$request->getBodyParam('enabledForSite', true),
            'newParentId' => $request->getBodyParam('parentId'),
        ]);

        if (($postDate = $request->getBodyParam('postDate')) !== null) {
            $entry->postDate = DateTimeHelper::toDateTime($postDate) ?: null;
        }

        if (($expiryDate = $request->getBodyParam('expiryDate')) !== null) {
            $entry->expiryDate = DateTimeHelper::toDateTime($expiryDate) ?: null;
        }

        $fieldsLocation = $request->getParam('fieldsLocation', 'fields');
        $entry->setFieldValuesFromRequest($fieldsLocation);

        return $entry;
    }