Проверяет, является ли раздел частью пути к текущему разделу в FO

@internal
@param Catalog $catalog раздел для проверки
@return bool
506808
public function inAppPath()
    	{
	   $app = Application::getInstance();
	   if (!$app->isFrontOffice()) return false;
	   return $app->getCatalog()->getPath()->has($this);
    }
531085
public function compile(): bool
    {
        // Delete old twig cache files
        if (file_exists($this->cachePath)) {
            $this->removeDirectory($this->cachePath);
        }

        if (!file_exists($this->cachePath)) {
            mkdir($this->cachePath);
        }

        // Iterate over all your templates and force compilation
        $this->twig->disableDebug();
        $this->twig->enableAutoReload();

        if (!$this->twig->getCache()) {
            throw new RuntimeException('The Twig cache must be enabled!');
        }

        $loader = $this->twig->getLoader();

        if ($loader instanceof FilesystemLoader) {
            $paths = $loader->getPaths();

            foreach ($paths as $path) {
                $this->compileFiles($path);
            }
        }

        return true;
    }
1319278
public function releaseLock()
    {
        //wyszukiwanie blokady dla kategorii
        if (null === $lockRecord = (new CacheQuery)->findPk($lockKey = self::CACHE_PREFIX . $this->_categoryId)) {
            //brak blokady
            return true;
        }
        //zwalnianie blokady z opóźnieniem
        $lockRecord->ttl = time() + self::RELEASE_TIMEOUT;
        return $lockRecord->save();
    }
390516
public function isOrm($entity)
    {
        $annotation = $this->getClassAnnotation($entity, 'Doctrine\ORM\Mapping\Entity');

        if ($annotation === null) {
            return false;
        }

        return true;
    }
634164
public function setCatalogue($catalogue)
    {
        if(!($catalogue instanceof KTranslatorCatalogueInterface))
        {
            if(is_string($catalogue) && strpos($catalogue, '.') === false )
            {
                $identifier			= $this->getIdentifier()->toArray();
                $identifier['path']	= array('translator', 'catalogue');
                $identifier['name'] = $catalogue;

                $identifier = $this->getIdentifier($identifier);
            }
            else $identifier = $this->getIdentifier($catalogue);

            $catalogue = $identifier;
        }

        $this->_catalogue = $catalogue;

        return $this;
    }
662331
static function delete($entity)
    {
        if ($entity->is_exists()){
            if ($store = self::getStore($entity->uri())) {
                return $store->delete($entity);
            }else{
                throw new Error('Неопределено хранилище объекта','store');
            }
        }else{
            return false;
        }
    }
813921
final public function delete($code) {

        if ( array_key_exists($code, $this->rpc_errors) ) {

            unset($this->rpc_errors[$code]);

            $this->logger->debug("Deleted error $code");

            return true;

        } else {

            $this->logger->warning("Cannot delete error $code: entry not found");

            return false;

        }

    }
406153
public function isCustomerSyncEnabled($website = 0)
    {
        $website = $this->storeManager->getWebsite($website);

        return $this->scopeConfig->isSetFlag(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_SYNC_CUSTOMER_ENABLED,
            \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE,
            $website
        );
    }
201520
public function setCatalogs(array $catalogs) {
		$cache = $this->getCacheFrontend();
		
		if (count($catalogs) === 1) {
			reset($catalogs);
			
			return $cache->set(key($catalogs), current($catalogs), $this->lifetime);
		}
		
		return $cache->setMany($catalogs, $this->lifetime);
	}
878191
public function add($item)
    {
        if (!$this->index)
        {
            $this->index();
        }

        $result = false;
        /* При добавлении свойство id должно устанавливаться БД */
        if (isset($item['id']))
        {
            unset($item['id']);
        }
        /* Если не указан родитель - добавляем в корень */
        if (!isset($item['owner']))
        {
            $item['owner'] = 0;
        }
        $item['created'] = gettime('Y-m-d H:i:s');
        $item['updated'] = $item['created'];
        $item['options'] = isset($item['options']) ? trim($item['options']) : '';
        $item['options'] = empty($item['options']) ?
            '' : encodeOptions(text2array($item['options'], true));

        if (!isset($item['position']) || !$item['position'])
        {
            $item['position'] = isset($this->index[$item['owner']]) ?
                count($this->index[$item['owner']]) : 0;
        }
        if (Eresus_CMS::getLegacyKernel()->db->insert($this->table, $item))
        {
            $result = $this->get(Eresus_CMS::getLegacyKernel()->db->getInsertedId());
        }
        return $result;
    }
366622
public function removePermission(AbstractCompanyUserPermission $permission): bool
    {
        if (empty($this->permissions)) {
            return true;
        }
        $permissions = $this->permissions;
        $key = array_search($permission->id, array_column($permissions, 'id'), true);
        unset($permissions[$key]); // удаление элемента
        $permissions = array_values($permissions);
        $this->permissions = $permissions;
        return $this->updateModel();
    }
96476
public function uploadKeys($catalog, $data)
    {
        $this->sprintfIfDebug("sending %d keys in catalog %s\n", count($data), $catalog);

        return $this->callService(
            self::SVC_UPLOAD_KEYS,
            array(
                'catalog'    => $catalog,
                'data'       => $data,
            )
        );
    }
610569
protected function _process()
	{
		$this->_msg('Adding catalog performance data', 0);


		$context =  $this->_getContext();
		$catalogManager = MShop_Catalog_Manager_Factory::createManager( $context );

		$catalogRootItem = $catalogManager->createItem();
		$catalogRootItem->setCode( 'home' );
		$catalogRootItem->setLabel( 'Home' );
		$catalogRootItem->setStatus( 1 );

		$catalogManager->insertItem( $catalogRootItem );

		for( $i = 1; $i <= 5; $i++ )
		{
			$catalogOneItem = $catalogManager->createItem();
			$catalogOneItem->setCode( 'cat-' . $i );
			$catalogOneItem->setLabel( 'cat-' . $i );
			$catalogOneItem->setStatus( 1 );

			$catalogManager->insertItem( $catalogOneItem, $catalogRootItem->getId() );

			for( $j = 1; $j <= 10; $j++ )
			{
				$catalogTwoItem = $catalogManager->createItem();
				$catalogTwoItem->setCode( 'cat-' . $i . ':' . $j );
				$catalogTwoItem->setLabel( 'cat-' . $i . ':' . $j );
				$catalogTwoItem->setStatus( 1 );

				$catalogManager->insertItem( $catalogTwoItem, $catalogOneItem->getId() );

				for( $k = 1; $k <= 10; $k++ )
				{
					$catalogThreeItem = $catalogManager->createItem();
					$catalogThreeItem->setCode( 'cat-' . $i . ':' . $j . ':' . $k );
					$catalogThreeItem->setLabel( 'cat-' . $i . ':' . $j . ':' . $k );
					$catalogThreeItem->setStatus( 1 );

					$catalogManager->insertItem( $catalogThreeItem, $catalogTwoItem->getId() );
				}
			}
		}


		$this->_status( 'done' );
	}
780362
public function gc($lifetime): bool
    {
        $pattern = $this->savePath . \DIRECTORY_SEPARATOR . $this->prefix . '*';
        foreach (\glob($pattern) as $file) {
            if (\filemtime($file) + $lifetime < \time() && \file_exists($file)) {
                \unlink($file);
            }
        }

        return true;
    }
720794
public function beforeSave()
    {
        $lang = \Mmi\App\FrontController::getInstance()->getRequest()->lang;
        foreach (\Cms\Orm\CmsTextQuery::byLang($this->source)->find() as $record) {
            /* @var $record \Cms\Orm\CmsTextRecord */
            if (\Cms\Orm\CmsTextQuery::byKeyLang($record->key, $lang)->findFirst() !== null) {
                continue;
            }
            //nowy rekord
            $r = \Cms\Orm\CmsTextRecord();
            $r->lang = $lang;
            $r->key = $record->key;
            $r->content = $record->content;
            $r->save();
        }
        return true;
    }
646542
def save_catalog(self, catalog_form, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.BinAdminSession.update_bin
        if catalog_form.is_for_update():
            return self.update_catalog(catalog_form, *args, **kwargs)
        else:
            return self.create_catalog(catalog_form, *args, **kwargs)
715144
protected function hasTranslatableTrait($class)
    {
        $translatable = config('cms-models.analyzer.traits.translatable', []);

        if ( ! count($translatable)) {
            // @codeCoverageIgnoreStart
            return false;
            // @codeCoverageIgnoreEnd
        }

        return (bool) count(array_intersect($this->classUsesDeep($class), $translatable));
    }