當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。