Handler::addEntry()

@return
327381
public function addEntry($data = [])
    {
        if(!$data)
            return false;
        (!isset($data[$this->databaseConfig->getIdentifier()])) ? $this->clearIdentifier() : $this->get($data[$this->databaseConfig->getIdentifier()]);
        foreach ($data as $name => $value){
            if ($this->checkField($name))
                $this->tableFields->{$name} = utf8_encode($value);
        }
        return $this->save();
    }
503926
public function add()
    {
        $args = func_get_args();
        foreach( $args as $arg ) {
            if( is_array($arg) ) {
                foreach( $arg as $value ) {
                    $this[] = $value;
                }
            } else {
                $this[] = $arg;
            }
        }
        return $this;
    }
940433
public function popEntry()
    {
        if (count($this->entries) == 0) {
            throw new IndexError;
        }
        $entry = array_pop($this->entries);
        $this->last_index -= 1;

        return $entry;
    }
1084149
public EntryBuffer append(Entry entry) {
    int offset = offset(entry.getIndex());
    Entry oldEntry = buffer[offset];
    buffer[offset] = entry.acquire();
    if (oldEntry != null) {
      oldEntry.release();
    }
    return this;
  }
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;
            }
        }
    }
261375
public function add()
    {
        $this->request->allowMethod(['post', 'patch', 'put']);
        $response = [
            'success' => false,
            'data' => [],
            'errors' => [],
        ];

        $calendarsTable = TableRegistry::get('Calendars');

        $data = $this->request->getData();
        $data = is_array($data) ? $data : [];
        if (empty($data['calendar_id'])) {
            $response['errors'][] = "Calendar ID is missing";
            $this->set(compact('response'));
            $this->set('_serialize', 'response');

            return $this->response;
        }

        $calendar = $calendarsTable->get($data['calendar_id']);
        $postData = $this->CalendarEvents->setCalendarEventData($data, $calendar);

        $calendarEvent = $this->CalendarEvents->newEntity();
        $calendarEvent = $this->CalendarEvents->patchEntity(
            $calendarEvent,
            $postData,
            [
                'associated' => ['CalendarAttendees'],
            ]
        );

        $saved = $this->CalendarEvents->save($calendarEvent);

        if ($saved) {
            $response['success'] = true;
            $response['data'] = $this->CalendarEvents->getEventInfo($saved->id, $calendar);
        } else {
            $response['errors'] = $calendarEvent->getErrors();
        }

        $this->set(compact('response'));
        $this->set('_serialize', 'response');
    }
225063
public static function createSentry()
	{
		$config = \Kohana::$config->load('sentry')->as_array();

		//If the user hasn't defined a config file offer defaults
		if ( count($config) == 0 )
		{
			$config = array(
				'session_driver' => 'native',
				'session_key' => 'cartalyst_sentry',
				'cookie_key' => 'cartalyst_sentry',
				'hasher' => 'Bcrypt'
			);
		}

		//Choose the hasher
		switch ( $config['hasher'] )
		{
			default:
			case 'Bcrypt':
				$hasher = new \Cartalyst\Sentry\Hashing\BcryptHasher;
				break;
			case 'Native':
				$hasher = new \Cartalyst\Sentry\Hashing\NativeHasher;
				break;
			case 'Sha256':
				$hasher = new \Cartalyst\Sentry\Hashing\Sha256Hasher;
				break;
		}

		return new BaseSentry(
			$userProvider = new UserProvider($hasher),
			new GroupProvider,
			new ThrottleProvider($userProvider),
			new KohanaSession(\Session::instance($config['session_driver']), $config['session_key']),
			new KohanaCookie($config['cookie_key']),
			\Request::$client_ip
		);
	}
1073321
private function add()
    {
        $columns = [];
        $values = [];
        //
        if ($this->_tracked) {
            $this->created_at = Time::current();
        }
        //
        foreach ($this->_columns as $value) {
            if ($value != $this->_keyName && isset($this->$value) && !empty($this->$value)) {
                $columns[] = $value;
                $values[] = $this->$value;
            }
        }
        //
        return $this->insert($columns, $values);
    }
1043734
private function addHistoryEntry($entry)
	{
		if($entry != null)
		{
			if($this->history == null)
				$this->history = array();
			$this->history[] = $entry;
		}
	}
672451
public function add($entry)
    {
        $this->log[] = $entry;
        while (count($this->log) > $this->size) {
            array_shift($this->log);
        }
    }
1092928
public function addCallableHandle()
    {
        if ($this->handler) {
            throw new AlreadyBuildedException('The handler already builded.');
        }

        $loader = new CallableLoader();
        $resolver = new CallableResolver();

        $this->addCallableResolver($resolver);
        $this->addActionLoader($loader);

        return $loader;
    }
1139369
public function add()
    {
        $position = $this->BannersPositions->newEntity();

        if ($this->request->is('post')) {
            $position = $this->BannersPositions->patchEntity($position, $this->request->getData());

            if ($this->BannersPositions->save($position)) {
                $this->Flash->success(I18N_OPERATION_OK);

                return $this->redirect(['action' => 'index']);
            }

            $this->Flash->error(I18N_OPERATION_NOT_OK);
        }

        $this->set(compact('position'));
    }
187682
public function addEntryWith(\hemio\html\Interface_\HtmlCode $withEntry)
    {
        $li = new \hemio\html\Li();
        $li->addChild($withEntry);
        return $this->addChild($li);
    }
598860
public function add() {
		if ($this->request->is('post')) {
			$this->Cliente->create();
			if ($this->Cliente->save($this->request->data)) {
				$this->Session->setFlash(__('The %s has been saved.', Configure::read('Mesa.tituloCliente')));
				return $this->redirect(array('action' => 'index'));
			} else {
				$this->Session->setFlash(__('The %s could not be saved. Please, try again.', Configure::read('Mesa.tituloCliente')));
			}
		}
		$descuentos = $this->Cliente->Descuento->find('list');
		$tipoDocumentos = $this->Cliente->TipoDocumento->find('list');
		$ivaResponsabilidades = $this->Cliente->IvaResponsabilidad->find('list');
		$this->set(compact('descuentos', 'tipoDocumentos', 'ivaResponsabilidades'));
		$this->render('form');
	}
1238484
public function addEntry( $line )
	{
		$tc = new Alg_Time_Converter();
		$entry = time()." [".$tc->convertToHuman( time(), "datetime" )."] ".$line."\n";

		$fp = @fopen( $this->uri, "ab" );
		if( $fp )
		{
			@fwrite( $fp, $entry );
			@fclose( $fp );
			return true;
		}
		return false;
	}
1016487
public function entry()
    {
        $this->defaultData();
        $entries = array();
        foreach (EntryPointService::getRegistry()->getEntryPoints() as $entry) {
            if (tao_models_classes_accessControl_AclProxy::hasAccessUrl($entry->getUrl())) {
                $entries[] = $entry;
            }
        }

        if (empty($entries)) {
            // no access -> error
            if (common_session_SessionManager::isAnonymous()) {
                /* @var $urlRouteService DefaultUrlService */
                $urlRouteService = $this->getServiceLocator()->get(DefaultUrlService::SERVICE_ID);
                $this->redirect($urlRouteService->getLoginUrl());
            } else {
                common_session_SessionManager::endSession();
                return $this->returnError(__('You currently have no access to the platform'), true, 403);
            }
        } elseif (count($entries) == 1 && !common_session_SessionManager::isAnonymous()) {
            // single entrypoint -> redirect
            $entry = current($entries);
            return $this->redirect($entry->getUrl());
        } else {
            // multiple entries -> choice
            if (!common_session_SessionManager::isAnonymous()) {
                $this->setData('user', $this->getSession()->getUserLabel());
            }
            $this->setData('entries', $entries);
            $naviElements = $this->getNavigationElementsByGroup('settings');
            foreach($naviElements as $key => $naviElement) {
                if($naviElement['perspective']->getId() !== 'user_settings') {
                    unset($naviElements[$key]);
                    continue;
                }
            }

            if ($this->hasRequestParameter('errorMessage')){
                $this->setData('errorMessage', $this->getRequestParameter('errorMessage'));
            }
            $this->setData('logout', $this->getServiceLocator()->get(DefaultUrlService::SERVICE_ID)->getLogoutUrl());
            $this->setData('userLabel', $this->getSession()->getUserLabel());
            $this->setData('settings-menu', $naviElements);
            $this->setData('current-section', $this->getRequestParameter('section'));
            $this->setData('content-template', array('blocks/entry-points.tpl', 'tao'));
            $this->setView('layout.tpl', 'tao');
        }
    }
99070
public function add()
    {
        $cmsTerm = $this->CmsTerm->newEntity();
        if ($this->request->is('post')) {
            $cmsTerm = $this->CmsTerm->patchEntity($cmsTerm, $this->request->data);
            if ($this->CmsTerm->save($cmsTerm)) {
                $this->Flash->success('The cms term has been saved.');
                return $this->redirect(['action' => 'index']);
            } else {
                $this->Flash->error('The cms term could not be saved. Please, try again.');
            }
        }
        $this->set(compact('cmsTerm'));
        $this->set('_serialize', ['cmsTerm']);
    }