Add an entry to the menu

@param $entry a MenuEntry
@param $push true if this is to be put before the rest of the items in the menue

@return Menu The instance is returned to allow chaining syntax
960496
public function add($entry, $push=false)
    {
        if ( $push ) {
            array_unshift($this->menu, $entry);
        } else {
            $this->menu[] = $entry;
        }
        return $this;
    }
638692
public function addMenuEntry($location, MenuEntry $menuEntry, $priority = 50)
    {
        if (!isset($this->menuEntries[$location])) {
            $this->menuEntries[$location] = array();
        }
        
        if (!isset($this->menuEntries[$location][$priority])) {
            $this->menuEntries[$location][$priority] = array();
        }

        if (isset($this->menuEntries[$location][$priority][$menuEntry->getKey()])) {
            return false;
        }
        
        $this->menuEntries[$location][$priority][$menuEntry->getKey()] = $menuEntry;
        
        ksort($this->menuEntries[$location]);
        uasort($this->menuEntries[$location][$priority], array($this, 'sortMenuEntries'));
        
        return true;
    }
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;
            }
        }
    }
258140
public function addEntry(LogEntry $entry)
	{
		echo $this->priorities[$entry->priority] . ': '
			. $entry->message . (empty($entry->category) ? '' : ' [' . $entry->category . ']')
			. $this->line_separator;
	}
1218699
protected function _createItem( array $entry )
	{
		$item = $this->_manager->createItem();

		foreach( $entry as $name => $value )
		{
			switch( $name )
			{
				case 'locale.site.id': $item->setId( $value ); break;
				case 'locale.site.code': $item->setCode( $value ); break;
				case 'locale.site.label': $item->setLabel( $value ); break;
				case 'locale.site.status': $item->setStatus( $value ); break;
				case 'locale.site.config': $item->setConfig( (array) $value ); break;
			}
		}

		return $item;
	}
36111
private static function importRecurse($entry, $depth) {
        if ( isset($entry->menu) ) $entry = $entry->menu; // Skip right past these
        if ( ! is_array($entry) ) {
            $link = $entry->link;
            $href = $entry->href;
            if ( is_string($href) ) {
                return new \Tsugi\UI\MenuEntry($link, $href);
            }
            $submenu = self::importRecurse($href, $depth+1);
            return new \Tsugi\UI\MenuEntry($link, $submenu);
        }

        $submenu = new \Tsugi\UI\Menu();
        foreach($entry as $child) {
            $submenu->add(self::importRecurse($child, $depth+1));
        }
        return $submenu;
    }
844895
public function push($item)
    {
        if (!is_array($item)) {
            $this->items = array_merge($this->items, [$item]);
            return $this;
        }
        $this->items = array_merge($this->items, $item);
        return $this;
    }
1303369
public function addEntry(AbstractEntry $entry, $prepend = false) {
        if ($prepend) {
            array_unshift($this->entries, $entry);
        } else {
            $this->entries[] = $entry;
        }
    }
864567
public function addLog(array $entry)
    {
        $this->log[] = $entry;

        if ($this->observer) {
            call_user_func($this->observer, $entry);
        }
    }
794329
public function addEntry($entry)
    {
        if (is_string($entry)) {
            $class = $this->getClassFromType($entry);

            if ($class === null) {
                throw new SwatClassNotFoundException(
                    'SwatHtmlHeadEntry class not found for entry string of "' .
                        $entry .
                        '".'
                );
            }

            $entry = new $class($entry);
        }

        if (!($entry instanceof SwatHtmlHeadEntry)) {
            throw new SwatInvalidTypeException(
                'Added entry must be either a string or an instance of a' .
                    'SwatHtmlHeadEntry.',
                0,
                $entry
            );
        }

        $uri = $entry->getUri();
        if (!array_key_exists($uri, $this->entries)) {
            $this->entries[$uri] = $entry;
        }
    }
1176531
public function insertVolume($entry, $location = null)
    {
        if ($location == null) {
            $uri = self::MY_LIBRARY_FEED_URI;
        } else {
            $uri = $location;
        }
        return parent::insertEntry(
            $entry, $uri, 'Zend_Gdata_Books_VolumeEntry');
    }
1360856
function pushToStack(type, entry, check) {
		// no entry of given type
		if (typeof stack[type] === 'undefined') {
			stack[type] = entry;
		}
		// apply check function
		else if (check(stack[type], entry) === true) {
			stack[type] = entry;
		}
	}
154561
def add_entry(id, title, updated, link, options={})
      entries << {
        :id => id,
        :title => title,
        :updated => updated,
        :link => link
        }.merge(options)
    end
995731
private function projectEntry(Entry $entry)
    {
        $date = $entry->getDateCreated();
        if ($date) {
            yield 'ccm_date_created' => $this->dateFormatter->formatCustom(\DateTime::ATOM, $date);
        } else {
            yield 'ccm_date_created' => null;
        }

        $attributes = $entry->getAttributes();
        foreach ($attributes as $attribute) {
            yield $attribute->getAttributeKey()->getAttributeKeyHandle() => $attribute->getPlainTextValue();
        }
    }
835281
protected void addEntry (E entry)
    {
        if (_entryFilter == null || _entryFilter.apply(entry)) {
            int index = _keys.insertSorted(getKey(entry));
            _table.insertDatum(entry, index);
        }
    }
1249783
public function push($value, $key = null)
    {
        if ($key == null) {
            $this->storage[] = $value;
        } else {
            $this->storage[$key] = $value;
        }

        return $this;
    }
392597
public function setEntry(Entry $entry)
    {
        $entry->setScriptEvents(true)
              ->checkId();
        $this->entry = $entry;
        return $this;
    }