Проверяет, имеется ли раздел в итераторе

@param Catalog $catalog раздел для проверки
@return bool
199072
public function has($catalog)
    {
		if ($catalog instanceof \Cetera\Catalog)
		{
			$cid = $catalog->id;
		}
		else
		{
			$cid = (int)$catalog;
		}
        foreach($this as $c) if ($c->id == $cid) return true;
        return false;
    }
263987
public function hasDirectPermission($permission): bool
    {
        $permissionClass = $this->getPermissionClass();

        if (is_string($permission)) {
            $permission = $permissionClass->findByName($permission, $this->getDefaultGuardName());
            if (! $permission) {
                return false;
            }
        }

        if (is_int($permission)) {
            $permission = $permissionClass->findById($permission, $this->getDefaultGuardName());
            if (! $permission) {
                return false;
            }
        }

        if (! $permission instanceof Permission) {
            return false;
        }

        return $this->permissions->contains('id', $permission->id);
    }
35404
public function execBatch(array $batch) : bool
    {
        $oldAttrEmulatePrepares = $this->getConnection()->getAttribute(\PDO::ATTR_EMULATE_PREPARES);
        $this->getConnection()->setAttribute(\PDO::ATTR_EMULATE_PREPARES, true);
        try {
            $this->getConnection()->exec($this->createQStrFromBatch($batch));
        } catch (\PDOException $e) {
            $this->getConnection()->exec('ROLLBACK');
            throw new BatchExecutionException('Ошибка выполнения пакета транзакций: ' . $e->getMessage());
        } finally {
            $this->getConnection()->setAttribute(\PDO::ATTR_EMULATE_PREPARES, $oldAttrEmulatePrepares);
        }

        return true;
    }
455131
public function getFilePath($subdir, $catalog = '', $webroot = false)
    {
        if(!($app_path = Yii::getAlias('@frontend')))
            $app = Yii::getAlias('@app');
        $path = ($webroot
            ? $app_path . '/web'
            : $this->base_path
        ) . $this->file_path . $this->add($subdir);
        return is_dir($app_path . '/web' . $this->file_path . $this->add($subdir) . $catalog) 
            ? $path . $this->add($catalog) 
            : $path;
    }
610678
public function decr($by = 1)
    {
        return (bool)$this->resque->getClient()->decrby($this->getKey(), $by);
    }
536151
protected function hasStaticPage()
    {
        if (!self::config()->enable_static_file) {
            return false;
        }

        // Attempt to retrieve content from generated file handler
        $filename = $this->getErrorFilename();
        $storeFilename = File::join_paths(self::config()->store_filepath, $filename);
        $result = self::get_asset_handler()->getContent($storeFilename);
        return !empty($result);
    }
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;

        }

    }
874272
public function contentExists() {
		$r = Catalog::getRoot();
		if (count($r->children) > 1) return true;
		if (count($r->children) < 1) return false;
		
		$s = $r->children[0];
		
		if (count($s->children)) return true;
		if (count($s->getMaterials()->unpublished())) return true;
		
		return false;
	}
307035
public function hasProductRestrictions($quote = null)
    {

        $toggleCheckout = $this->configHelper->getToggleCheckout();

        if (!$toggleCheckout || !$toggleCheckout->active) {
            return false;
        }

        // get configured Product model getters that can restrict Bolt checkout usage
        $productRestrictionMethods = $toggleCheckout->productRestrictionMethods ?: [];

        // get configured Quote Item getters that can restrict Bolt checkout usage
        $itemRestrictionMethods = $toggleCheckout->itemRestrictionMethods ?: [];

        if (!$productRestrictionMethods && !$itemRestrictionMethods) {
            return false;
        }

        /** @var Quote $quote */
        $quote = $quote ?: $this->checkoutSession->getQuote();
        foreach ($quote->getAllVisibleItems() as $item) {
            // call every method on item, if returns true, do restrict
            foreach ($itemRestrictionMethods as $method) {
                if ($item->$method()) {
                    return true;
                }
            }
            // Non empty check to avoid unnecessary model load
            if ($productRestrictionMethods) {
                // get item product
                $product = $this->productFactory->create()->load($item->getProductId());
                // call every method on product, if returns true, do restrict
                foreach ($productRestrictionMethods as $method) {
                    if ($product->$method()) {
                        return true;
                    }
                }
            }
        }

        // no restrictions
        return false;
    }
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)
396969
public function hasSupport($dir = null)
    {
        try {
            list ($output) = $this->getSystemService()->execute('bin/phpunit --version', $dir);

            if (0 < preg_match('/^PHPUnit\s+[0-9]+\.[0-9]+\.[0-9]+/', $output)) {
                return true;
            }
            return false;
        } catch (\Exception $e) {
            return false;
        }
    }
936576
public function hasBuckram( $version = 0 ) {
		if ( $this->isCurrentThemeCompatible( 2 ) && version_compare( $this->getBuckramVersion(), $version ) >= 0 ) {
			return true;
		}
		return false;
	}
110344
public function matches(ConstraintInterface $provider)
    {
        if (false === $this->conjunctive) {
            foreach ($this->constraints as $constraint) {
                if ($constraint->matches($provider)) {
                    return true;
                }
            }

            return false;
        }

        foreach ($this->constraints as $constraint) {
            if (!$constraint->matches($provider)) {
                return false;
            }
        }

        return true;
    }
753733
public function setCatalogs(array $catalogs) {
		$cache   = $this->getCacheFrontend();
		$domains = [];
			
		foreach ($catalogs as $locale => $localeData) {
			foreach ($localeData as $domain => $domainData) {
				if (! isset($domains[$domain])) {
					$domains[$domain] = [];
				}

				$domains[$domain][$locale] = [$domain => $domainData];
			}
		}
		
		if (count($domains) === 1) {
			reset($domains);
			
			return $cache->set(key($domains), current($domains), $this->lifetime);
		}
		
		return $cache->setMany($domains, $this->lifetime);
	}
1281813
public function configure(array $configuration) : bool
    {
        //====================================================================//
        // Setup Connector Configuration
        $this->getConnector()->configure(
            $this->getWebserviceId(),
            $this->getWebserviceId(),
            $configuration
        );
        //====================================================================//
        // Mark Connector as Configured
        return $this->identified = true;
    }
518781
public function cd($dir = '')
    {
        $this->errorHandler->start();
        if ($this->driver->chdir($dir)) {
            $this->errorHandler->stop();

            return true;
        }
        $this->errorHandler->stop();

        return false;
    }
1132672
public function delete($key)
    {

        $deleted = false;

        $catalog = \array_keys($this->getKeys());
        foreach ($catalog as $k) {

            if (substr($k, 0, strlen($key)) == $key) {

                $delete = $this->memcache->delete($this->namespace . $key);
                if ($delete) {
                    $this->catalogKeyDelete($k);
                    $deleted = true;
                }
            }
        }

        return $deleted;
    }