Increment by one the repository accesses type.

@param string $repository
@param string $type

@return PersisterInterface
320171
public function incrementRepositoryAccessType($repository, $type)
    {
        $this->redis->hincrby($this->concatenateKeys($this->keyHash, $repository), $type, 1);

        return $this;
    }
363251
public static function loadRepository(CacheRepositoryInterface $repository)
  {
    return self::getOrInit(get_class($repository), function () use ($repository) {
      return $repository->getSingleton();
    });
  }
1212578
public function insert($repository, $data)
    {
        $context = $this->getCommandContext();

        $context->data = $data;
        $context->repository = $repository;

        if ($this->getCommandChain()->run('before.insert', $context) !== false) {
            $vals = array();

            $this->_adapter->getConnection()->autocommit(false);

            $resources = $repository->getResources();

            foreach ($data as $column => $val) {
                $column = $resources->getColumn($column);
                $key = $column->resource->getAlias();
                if (!isset($vals[$key])) {
                    $vals[$key] = array();
                }

                $vals[$key][$this->quoteName($column->name)] = $this->quoteValue($val);
            }

            $main_insert_id = null;

            foreach ($resources as $resource) {
                //check if therre now columns to be saved then probably a second empty
                //table so lets create an empty record
                $columns = isset($vals[$resource->getAlias()]) ? array_keys($vals[$resource->getAlias()])   : array();
                $values = isset($vals[$resource->getAlias()]) ? array_values($vals[$resource->getAlias()]) : array();

                if ($resource !== $resources->main()) {
                    $link = $resource->getLink();
                    $columns[] = $link->child;
                    $values[] = $main_insert_id;
                }

                $query = 'INSERT INTO '.$this->_adapter->getTablePrefix().$resource->getName()
                         .'('.implode(', ', $columns).') VALUES ('.implode(', ', $values).')';

                $this->execute($query);

                if ($resource === $resources->main()) {
                    $main_insert_id = $this->_adapter->getInsertId();
                }
            }

            $this->_adapter->getConnection()->commit();
            $this->_adapter->getConnection()->autocommit(true);

            $context->result = $main_insert_id;

            $this->getCommandChain()->run('after.insert', $context);
        }

        return $context->result;
    }
270390
public function restoreIfDeleted(Entity $entity = null, Repository $repository = null)
    {
        if ($this->deleted_at) {
            return $this->restore();
        }

        return $this;
    }
474677
public function increment($key, $value = 1)
    {
        if ($this->exists($key)) {
            return self::$redis->incrBy($key, $value);
        } else {
            $this->set($key, $value);

            return $value;
        }
    }
960213
public function push($repository = null, $refspec = null)
    {
        $command = 'push';

        if ($repository) {
            $command .= " $repository";
        }

        if ($refspec) {
            $command .= " $refspec";
        }

        $this->getClient()->run($this, $command);

        return $this;
    }
1138756
public function create($repository)
    {

        //if repository is a string
        //given repository should be a valid directory path
        if (is_string($repository)) {
            //clear stat cache to avoid loading cached files,
            //which where unlinked in system
            clearstatcache(TRUE);
            if (!is_dir($repository)) {
                throw new FileNotFoundException($repository);
            }

            $repository = new FilesystemRepository($repository);
        }

        //if there is no valid instance cancel creation
        if (!($repository instanceof FilesystemRepository)) {
            throw new \RuntimeException(sprintf('Expected instance of FilesystemRepository. %s given', get_class($repository)));
        }

        $locator = new Locator($repository);

        return $locator;
    }
1095423
public function setType( $type )
    {
        $this->type = is_int( $type ) ? $type : self::getStorableType( $type );
        return $this;
    }
1213189
public static function get($type)
    {
        if (!isset(static::$_modelFactories['Table'])) {
            static::$_modelFactories['Table'] = [TableRegistry::getTableLocator(), 'get'];
        }

        if (!isset(static::$_modelFactories[$type])) {
            throw new InvalidArgumentException(sprintf(
                'Unknown repository type "%s". Make sure you register a type before trying to use it.',
                $type
            ));
        }

        return static::$_modelFactories[$type];
    }
971450
public function withRepository(Repository $repository) : TransactionalBusesBuilder
    {
        $this->repository = $repository;
        $this->useDirectCommandBus();
        return $this;
    }
1071747
public function getEntities($repository = null)
    {
        return $repository ? $this->_entities->getRepositoryEntities($repository) : $this->_entities;
    }
1190067
public function setRepository(Repository $repository, $default = null, $customName = null)
    {
        if ($default === true) {
            $this->repository = $repository;
        }

        $name = $customName ?: $repository->getName();
        $name = $name ?: uniqid();

        $this->repositories[strtolower($name)] = $repository;

        return $this;
    }
1177519
public function persist($object, $collection = null)
    {
        $repository = $this->getRepository(get_class($object), $collection);
        $repository->getClassMetadata()->getEventManager()->execute(EventManager::EVENT_PRE_PERSIST, $object);
        $this->addObject($object, ObjectManager::OBJ_NEW, $repository);
        $repository->getClassMetadata()->getEventManager()->execute(EventManager::EVENT_POST_PERSIST, $object);

        return $this;
    }
615685
public function incrementColumn($type, $increment = 1)
    {
        if ($type === 'new') {
            return $this->incrementColumnInNew($increment);
        }

        return $this->incrementColumnInOld($increment);
    }
326707
public function type($type = null)
    {
        if (!func_num_args()) {
            return $this->_type;
        }
        $this->_type = $type;
        return $this;
    }
794183
public static function get_type_by_typename($typename) {
        global $DB;
        $cache = cache::make('core', 'repositories');
        if (($repositorytype = $cache->get('typename:'. $typename)) === false) {
            $repositorytype = null;
            if ($record = $DB->get_record('repository', array('type' => $typename))) {
                $repositorytype = new repository_type($record->type, (array)get_config($record->type), $record->visible, $record->sortorder);
                $cache->set('typeid:'. $record->id, $repositorytype);
            }
            $cache->set('typename:'. $typename, $repositorytype);
        }
        return $repositorytype;
    }
974100
public static function getInstance($type, $init)
    {

        if (!self::$cachingInstance) {
            self::$cachingInstance = new IDS_Caching_Database($type, $init);
        }
        return self::$cachingInstance;
    }