本文整理汇总了PHP中thebuggenie\core\entities\Project::getProjectsCount方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::getProjectsCount方法的具体用法?PHP Project::getProjectsCount怎么用?PHP Project::getProjectsCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thebuggenie\core\entities\Project
的用法示例。
在下文中一共展示了Project::getProjectsCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hasProjectsAvailable
public function hasProjectsAvailable()
{
return $this->getMaxProjects() ? Project::getProjectsCount() < $this->getMaxProjects() : true;
}
示例2: runDeleteProject
/**
* Delete a project
*
* @param framework\Request $request The request object
*/
public function runDeleteProject(framework\Request $request)
{
$i18n = framework\Context::getI18n();
if ($this->access_level == framework\Settings::ACCESS_FULL) {
try {
$theProject = entities\Project::getB2DBTable()->selectByID($request['project_id']);
$theProject->setDeleted();
$theProject->save();
return $this->renderJSON(array('title' => $i18n->__('The project was deleted'), 'total_count' => entities\Project::getProjectsCount(), 'more_available' => framework\Context::getScope()->hasProjectsAvailable()));
} catch (\Exception $e) {
$this->getResponse()->setHttpStatus(400);
return $this->renderJSON(array('error' => $i18n->__('An error occured') . ': ' . $e->getMessage()));
}
}
$this->getResponse()->setHttpStatus(400);
return $this->renderJSON(array("error" => $i18n->__("You don't have access to remove projects")));
}
示例3: __
<div style="width: 730px;">
<h3><?php
echo __('Configure projects');
?>
</h3>
<div class="content faded_out">
<p>
<?php
echo __('More information about projects, editions, builds and components is available from the %wiki_help_section.', array('%wiki_help_section' => link_tag(make_url('publish_article', array('article_name' => 'Category:Help')), '<b>' . __('Wiki help section') . '</b>')));
?>
<?php
if (\thebuggenie\core\framework\Context::getScope()->getMaxProjects()) {
?>
<div class="faded_out dark" style="margin: 12px 0;">
<?php
echo __('This instance is using %num of max %max projects', array('%num' => '<b id="current_project_num_count">' . \thebuggenie\core\entities\Project::getProjectsCount() . '</b>', '%max' => '<b>' . \thebuggenie\core\framework\Context::getScope()->getMaxProjects() . '</b>'));
?>
</div>
<?php
}
?>
</p>
</div>
<?php
if ($access_level == \thebuggenie\core\framework\Settings::ACCESS_FULL) {
?>
<div class="lightyellowbox" style="padding: 5px; margin: 10px 0;<?php
if (!\thebuggenie\core\framework\Context::getScope()->hasProjectsAvailable()) {
?>
display: none;<?php
}