当前位置: 首页>>代码示例>>PHP>>正文


PHP category::setId方法代码示例

本文整理汇总了PHP中category::setId方法的典型用法代码示例。如果您正苦于以下问题:PHP category::setId方法的具体用法?PHP category::setId怎么用?PHP category::setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在category的用法示例。


在下文中一共展示了category::setId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: save

 /**
  * Saves an category into the database.
  *
  * @param \GamyGoody\Domain\category $category The category to save
  */
 public function save(category $category)
 {
     $categoryData = array('cat_title' => $category->getTitle());
     if ($category->getId()) {
         // The category has already been saved : update it
         $this->getDb()->update('category', $categoryData, array('cat_id' => $category->getId()));
     } else {
         // The category has never been saved : insert it
         $this->getDb()->insert('category', $categoryData);
         // Get the id of the newly created category and set it on the entity.
         $id = $this->getDb()->lastInsertId();
         $category->setId($id);
     }
 }
开发者ID:polytechlyon-isi2,项目名称:GamyGoody,代码行数:19,代码来源:CategoryDAO.php

示例2: category

			  <button type="reset" name="cancel" class="red"><?php 
        echo $language['cancel'];
        ?>
</button>
			</div>
		</form>
        
<?php 
    } else {
        if (isset($_POST['published'])) {
            $_POST['published'] = true;
        } else {
            $_POST['published'] = false;
        }
        $category = new category();
        $category->setId(intval($_GET['i']));
        $category->setContent($_POST['title_1'], $_POST['description_1'], $_POST['title_2'], $_POST['description_2'], $_POST['title_3'], $_POST['description_3'], $_POST['title_4'], $_POST['description_4'], $_POST['title_5'], $_POST['description_5'], $_POST['title_6'], $_POST['description_6'], $_POST['code']);
        $category->setUserId($account["name"]);
        $category->setDateUpdate();
        $category->setPublished($_POST['published']);
        $category->setCategoryType($_POST['category_type']);
        if ($category->update()) {
            print 'sucess';
        } else {
            print 'failure';
        }
    }
} else {
    print 'error';
}
?>
开发者ID:DaniJCV,项目名称:BO2-BOxygen,代码行数:31,代码来源:category_edit.php

示例3: category

print $language["template"]["del"];
?>
</button>
	</div>
	<table class="db-list">
	  <tr>
		<th>#</th>
		<th>Titulo</th>
		<th>Categoria</th>
		<th>Pub.</th>
		<th>Sel.</th>
	  </tr>
	  <?php 
foreach ($article_list as $article) {
    $object_category = new category();
    $object_category->setId($article['category_id']);
    $category = $object_category->returnOneCategory();
    if ($article['published']) {
        $published = '<img src="./site-assets/images/icon_on.png" alt="on" title="publicado"/>';
    } else {
        $published = '<img src="./site-assets/images/icon_off.png" alt="off"  title="não publicado"/>';
    }
    print '<tr>' . '<td>' . $article['id'] . '</td>' . '<td>' . $article['title_1'] . '</td>' . '<td>' . $category['name_1'] . '</td>' . '<td>' . $published . '</td>' . '<td><input type="radio" name="article" value="' . $article['id'] . '"/></td>' . '</tr>';
}
?>
	</table>
	<div class="button-area">
		<button onclick="goTo('./backoffice.php?pg=article-add');" class="green"><?php 
print $language["template"]["add"];
?>
</button>  
开发者ID:DaniJCV,项目名称:BO2-BOxygen,代码行数:31,代码来源:article_list.php

示例4: category

<?php

if (isset($_REQUEST['i']) && !empty($_REQUEST['i'])) {
    $object_category = new category();
    $object_category->setId($_REQUEST['i']);
    if ($object_category->delete()) {
        print 'sucess';
    } else {
        print 'error';
    }
} else {
    print 'error';
}
开发者ID:DaniJCV,项目名称:BO2-BOxygen,代码行数:13,代码来源:category_del.php

示例5: category

?>
</button>
	</div>
	<table class="db-list">
	  <tr>
		<th>#</th>
		<th>Produto</th>
		<th>Categoria</th>
		<th>Pub.</th>
		<th>Sel.</th>
	  </tr>
	  <?php 
$i_last = 0;
foreach ($product_list as $product) {
    $object_category = new category();
    $object_category->setId($product['category_id']);
    $category = $object_category->returnOneCategory();
    if ($product['published']) {
        $published = '<img src="./site-assets/images/icon_on.png" alt="on" />';
    } else {
        $published = '<img src="./site-assets/images/icon_off.png" alt="off" />';
    }
    print '<tr>' . '<td>' . $product['id'] . '</td>' . '<td>' . $product['title_1'] . '</td>' . '<td>' . $category['name_1'] . '</td>' . '<td>' . $published . '</td>' . '<td><input type="radio" name="product" value="' . $product['id'] . '"/></td>' . '</tr>';
    $i_last = $product['id'];
}
?>
	</table>
	<div class="button-area">
		<button onclick="goTo('./backoffice.php?pg=product-add');" class="green"><?php 
print $language["template"]["add"];
?>
开发者ID:DaniJCV,项目名称:BO2-BOxygen,代码行数:31,代码来源:product_list.php


注:本文中的category::setId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。