本文整理汇总了PHP中Categorie类的典型用法代码示例。如果您正苦于以下问题:PHP Categorie类的具体用法?PHP Categorie怎么用?PHP Categorie使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Categorie类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: buildDomainObject
/**
* Creates an Category object based on a DB row.
*
* @param array $row The DB row containing Category data.
* @return \MyMovies\Domain\Category
*/
protected function buildDomainObject($row)
{
$cat = new Categorie();
$cat->setCat_id($row['cat_id']);
$cat->setCat_name($row['cat_name']);
return $cat;
}
开发者ID:Variot,项目名称:MyMovies,代码行数:13,代码来源:CategoryDAO.php
示例2: update
public function update(Categorie $categorie)
{
$query = $this->_db->prepare('UPDATE categorie SET nom=:nom, detail=:detail WHERE id=:id');
$query->bindValue(':nom', $categorie->nom());
$query->bindValue(':detail', $categorie->detail());
$query->bindValue(':id', $categorie->id());
$query->execute();
$query->closeCursor();
}
开发者ID:aassou,项目名称:Venditoo,代码行数:9,代码来源:CategorieManager.class.php
示例3: setQuestions
private function setQuestions()
{
$categories = new Categorie();
$questions = new Question();
$questions->readQuestions($categories->getCategories());
$tabUn = $questions->getUn();
$tabAutre = $questions->getAutre();
$this->_questions = array('lun1' => $tabUn[0], 'lautre1' => $tabAutre[0], 'lun2' => $tabUn[1], 'lautre2' => $tabAutre[1]);
}
开发者ID:thecampagnards,项目名称:Projet-BurgerQuiz,代码行数:9,代码来源:partie.class.php
示例4: getCategorie
function getCategorie($id)
{
$result = $this->connector->query("SELECT * FROM categorie WHERE `cat_id` = '{$id}'");
while ($row = $this->connector->fetchArray($result)) {
$categorie = new Categorie();
$categorie->setCat_id($row['cat_id']);
$categorie->setCat_title($row['cat_title']);
$categorie->setCat_despription($row['cat_despription']);
return $categorie;
}
}
开发者ID:sachinimalindi,项目名称:simphpcms,代码行数:11,代码来源:CategorieModel.php
示例5: create
public function create($nom)
{
$category = new Categorie($this->link);
$category->setTitre($nom);
$nom = mysqli_real_escape_string($this->link, $category->getCategory());
$request = "INSERT INTO categories VALUES(NULL, '" . $nom . "')";
$res = mysqli_query($this->link, $request);
if ($res) {
return $this->select(mysqli_insert_id($this->link));
} else {
throw new Exception("Internal server error");
}
}
开发者ID:jmgerber,项目名称:forum,代码行数:13,代码来源:CategorieManager.class.php
示例6: procede
public function procede()
{
if (!$this->oRequest->existParam('key')) {
throw new Error('Vous devez renseigner la clé.', 3003);
}
if ($this->oRequest->getParam('key', 'string') != Config::get('ingestkey')) {
throw new Error('La clé est invalide.', 3003);
}
//Ajoute du titre
$this->oView->addData('titre', 'Analyse des releases');
//On récupère les 30 dernières releases
$oMysqli = Database::getInstance();
//Traitement de la requête
$sSqlRequest = "SELECT r.*, \r\n (SELECT GROUP_CONCAT(t.id_regex ORDER BY t.id_regex SEPARATOR ';') FROM tks_tags t WHERE t.id_release = r.id) AS tags,\r\n (SELECT GROUP_CONCAT(f.date ORDER BY f.date SEPARATOR ';') FROM tks_torrents f WHERE f.id_release = r.id) AS dates\t\r\n FROM tks_releases r \r\n WHERE r.id_categorie = '0' \r\n ORDER BY r.id DESC \r\n LIMIT 10";
$oResults = $oMysqli->query($sSqlRequest);
$oTable = new TableGenerator();
$oTable->setId(md5('Scrapper'));
$oTable->addColumn('Release');
$oTable->addColumn('Catégorie');
$oTable->addColumn('ID Fiche');
$aCategories = Categorie::getCategoriesSelect();
while ($aResult = $oResults->fetch_assoc()) {
$oScrapper = new Scrapper($aResult['name'], $aResult['id']);
$oScrapper->procede();
$oTable->addLine(array($aResult['name'], $aCategories[$oScrapper->getCategorie()], $oScrapper->getFiche()));
}
$oTable->setBottom('');
$oTable->create();
$this->oView->addData('content', $oTable->getCode());
$this->oView->Create();
}
开发者ID:Jatax,项目名称:TKS,代码行数:31,代码来源:scrapper.controller.php
示例7: recupereCategorie
function recupereCategorie()
{
$categories = Categorie::fetchAll();
//Change l'ordre selon la fonction de comparaison cmp.
usort($categories, "cmp");
return $categories;
}
开发者ID:Tri125,项目名称:LogiKek,代码行数:7,代码来源:gestionCategories.php
示例8: getAllCategories
public static function getAllCategories()
{
$results = Categorie::select('name', 'id')->orderBy('name', 'asc')->get();
$allCategories = array();
foreach ($results as $result) {
$allCategories = array_add($allCategories, $result->id, $result->name);
}
return $allCategories;
}
开发者ID:jeroenjvdb,项目名称:AVuitleendienst,代码行数:9,代码来源:Categorie.php
示例9: beheerMateriaal
public function beheerMateriaal()
{
if (Auth::check()) {
$categories = Categorie::with('materials')->get();
return View::make('users.admin.beheerMateriaal', ['categories' => $categories]);
} else {
return Redirect::to('/');
}
}
开发者ID:jeroenjvdb,项目名称:AVuitleendienst,代码行数:9,代码来源:HomeController.php
示例10: up
/**
* Make changes to the database.
*
* @return void
*/
public function up()
{
//
Schema::create('categories', function ($table) {
$table->increments('id');
$table->string('title');
});
$cat = new Categorie();
$cat->title = "Wood";
$cat->save();
$cat = new Categorie();
$cat->title = "Metal";
$cat->save();
$cat = new Categorie();
$cat->title = "Ceramic";
$cat->save();
$cat = new Categorie();
$cat->title = "Glass";
$cat->save();
$cat = new Categorie();
$cat->title = "Fabric";
$cat->save();
$cat = new Categorie();
$cat->title = "Plastic";
$cat->save();
$cat = new Categorie();
$cat->title = "Concrete";
$cat->save();
$cat = new Categorie();
$cat->title = "Appliances";
$cat->save();
$cat = new Categorie();
$cat->title = "Electical";
$cat->save();
$cat = new Categorie();
$cat->title = "Plumbing";
$cat->save();
$cat = new Categorie();
$cat->title = "Insulation";
$cat->save();
$cat = new Categorie();
$cat->title = "Other";
$cat->save();
}
开发者ID:angmark0309,项目名称:remarket,代码行数:49,代码来源:2013_02_26_013628_create_categories.php
示例11: __construct
/**
* Initialise les variables en tableaux, et crée l'ensemble des catégories question de la partie
*/
function __construct()
{
$bddConnect = new Connector();
$this->tabCategorie = array();
$this->tabTheme1 = array();
$this->tabTheme2 = array();
$this->tabQuestion = array();
$this->tabReponse = array();
$this->tabExplication = array();
// étape actuelle de la partie (1 étape = 1 question)
$this->position = 0;
// création et récupération des catégories de la partie
$Categorie = new Categorie($bddConnect->getBdd());
$nomCategorie = $Categorie->getNomCategorie();
for ($i = 0; $i < sizeof($nomCategorie); $i++) {
// création et récupération des thèmes de la partie associés aux catégories choisies
$Theme = new Theme($bddConnect->getBdd(), $nomCategorie[$i]);
$idTheme = $Theme->getIdTheme();
$theme1 = $Theme->getTheme1();
$theme2 = $Theme->getTheme2();
for ($j = 0; $j < sizeof($theme1); $j++) {
// cration et récupération des questions de la partie associées aux thémes
$Question = new Question($bddConnect->getBdd(), $idTheme[$j]);
$intituleQuestion = $Question->getIntituleQuestion();
$reponse = $Question->getReponse();
$explication = $Question->getExplication();
for ($h = 0; $h < sizeof($intituleQuestion); $h++) {
// 1 indice de chauqe tableau équivaut au catégorie / theme question / ... de la question actuelle
array_push($this->tabCategorie, $nomCategorie[$i]);
array_push($this->tabTheme1, $theme1[$j]);
array_push($this->tabTheme2, $theme2[$j]);
array_push($this->tabQuestion, $intituleQuestion[$h]);
array_push($this->tabReponse, $reponse[$h]);
// s'il existe ou non une explication de la réponse
if (isset($explication[$h])) {
array_push($this->tabExplication, $explication[$h]);
} else {
array_push($this->tabExplication, null);
}
}
}
}
}
开发者ID:EvanGuelard,项目名称:BurgerQuiz,代码行数:46,代码来源:game.class.php
示例12: findAll
/**
*
* @return array A list of all Links.
*/
public function findAll()
{
$sql = "select * from rit_link";
$result = $this->getDb()->fetchAll($sql);
// Convert query result to an array of domain objects
$links = array();
foreach ($result as $row) {
$linkId = $row['lnk_id'];
$links[$linkId] = $this->buildDomainObject($row);
if (null !== $row['cat_id']) {
$sql2 = "select * from rit_categories";
$r2 = $this->getDb()->fetchAll($sql2);
$cat = new Categorie();
$cat->setId($r2[0]['cat_id']);
$cat->setName($r2[0]['cat_name']);
$links[$linkId]->setArticle($cat);
}
}
return $links;
}
开发者ID:lilemon63,项目名称:PHP_Project_ReadItLater,代码行数:24,代码来源:LinkDAO.php
示例13: run
public function run()
{
Eloquent::unguard();
DB::statement('SET FOREIGN_KEY_CHECKS=0;');
DB::table('categories')->delete();
Categorie::create(array('user_id' => 2, 'nom' => 'Men Cat 1', 'nomcourt' => 'M1', 'sexe_id' => 1, 'hcpmin' => -5, 'hcpmax' => 18.4, 'agemin' => 30, 'agemax' => 99, 'agelimityear' => 0, 'tee_id' => 3));
Categorie::create(array('user_id' => 2, 'nom' => 'Men Cat 2', 'nomcourt' => 'M2', 'sexe_id' => 1, 'hcpmin' => 18.5, 'hcpmax' => 36, 'agemin' => 30, 'agemax' => 99, 'agelimityear' => 0, 'tee_id' => 4));
Categorie::create(array('user_id' => 2, 'nom' => 'Ladies Cat 1', 'nomcourt' => 'L1', 'sexe_id' => 2, 'hcpmin' => -5, 'hcpmax' => 20.4, 'agemin' => 30, 'agemax' => 99, 'agelimityear' => 0, 'tee_id' => 6));
Categorie::create(array('user_id' => 2, 'nom' => 'Ladies Cat 2', 'nomcourt' => 'L2', 'sexe_id' => 2, 'hcpmin' => 20.5, 'hcpmax' => 36, 'agemin' => 30, 'agemax' => 99, 'agelimityear' => 0, 'tee_id' => 7));
DB::statement('SET FOREIGN_KEY_CHECKS=1;');
}
开发者ID:birdiebel,项目名称:G2016,代码行数:11,代码来源:CategoriesTableSeeder.php
示例14: supprimerCategorie
public static function supprimerCategorie($nom)
{
$nomCat = Categorie::getDefaultCategorie();
require_once "../Modele/Film.class.php";
$films = Film::getListeFilms();
foreach ($films as $film) {
if ($film['categorie'] == $nom) {
Film::setDefaultCategorie($nomCat['nom'], $film['id']);
}
}
SingletonRequete::getBase()->requeteParam("DELETE FROM Category WHERE category_name=?", array($nom));
}
开发者ID:polytechlyon-isi1web,项目名称:mymovies-YannickMontes,代码行数:12,代码来源:Categorie.class.php
示例15: ajax_categoria
function ajax_categoria()
{
$macro = $_REQUEST["macro"];
$suffisso = $_REQUEST["suffisso"];
//query sulle categorie
$objCat = new Categorie();
$arrCat = $objCat->getAll(" and cat_fkclasse=" . $macro . " order by cat_sorting");
$num = count($arrCat);
if ($num == 0) {
print "- - <input type='hidden' name='categoria" . $suffisso . "' value=''>";
} else {
print "<select name='categoria" . $suffisso . "' id='categoria" . $suffisso . "' class='select' onChange=\"ajaxSottocat('','" . $suffisso . "'); ajaxProdotto('','" . $suffisso . "'); \"><option value=''></option>";
foreach ($arrCat as $arr) {
print "<option value='" . $arr["cat_id"] . "'";
if (isset($_REQUEST["evidenza"]) && $_REQUEST["evidenza"] == $arr["cat_id"]) {
print " selected";
}
print ">" . $arr["cat_categoria"] . "</option>";
}
print "</select>";
}
}
开发者ID:pnicorelli,项目名称:cms-startkit,代码行数:22,代码来源:funzioni_ajax.php
示例16: add
/**
* @param string $backUrl
* @param int $categorie_id
* @return \Illuminate\Http\RedirectResponse
*/
public function add($backUrl = 'compet', $categorie_id = 0)
{
if ($categorie_id == 0) {
return Redirect::route($backUrl);
}
$categorie = Categorie::find($categorie_id);
$userclub = new Competcategorie();
$userclub->categorie_id = $categorie->id;
$userclub->compet_id = MySession::getModel('compet')->id;
$userclub->tee_id = $categorie->tee_id;
$userclub->save();
return Redirect::route($backUrl);
}
开发者ID:birdiebel,项目名称:G2016,代码行数:18,代码来源:CompetcategoriesController.php
示例17: getSamePost
public static function getSamePost($id = "", $cate = "", $limit)
{
if ($cate != "" && $id != "") {
if (Post::where('categorieID', $cate)->count() > 4) {
$data = DB::select(" SELECT * FROM posts WHERE categorieID = {$cate} AND id != {$id} ORDER BY id ASC LIMIT 0, {$limit} ");
} else {
$parent = Categorie::find($cate)->parent;
$data = DB::select(" SELECT * FROM posts WHERE parent = {$parent} AND id != {$id} ORDER BY id ASC LIMIT 0, {$limit} ");
}
} else {
$data = DB::select("SELECT * FROM posts WHERE parent = 1 ORDER BY id DESC LIMIT 0, {$limit} ");
}
return $data;
}
开发者ID:minnb,项目名称:vitduct,代码行数:14,代码来源:Template.php
示例18: _categories
function _categories($fk_parent = 0, $keyword = '')
{
global $db, $conf;
$TFille = array();
if (!empty($keyword)) {
$resultset = $db->query("SELECT rowid FROM " . MAIN_DB_PREFIX . "categorie WHERE label LIKE '%" . addslashes($keyword) . "%' ORDER BY label");
while ($obj = $db->fetch_object($resultset)) {
$cat = new Categorie($db);
$cat->fetch($obj->rowid);
$TFille[] = $cat;
}
} else {
$parent = new Categorie($db);
if (empty($fk_parent)) {
if (empty($conf->global->SPC_DO_NOT_LOAD_PARENT_CAT)) {
$TFille = $parent->get_all_categories(0, true);
}
} else {
$parent->fetch($fk_parent);
$TFille = $parent->get_filles();
}
}
return $TFille;
}
开发者ID:ATM-Consulting,项目名称:dolibarr_module_searchproductcategory,代码行数:24,代码来源:interface.php
示例19: callSelectOption
public static function callSelectOption($parent)
{
$result = array('--- Root ---');
$data = DB::select("SELECT * FROM categories");
foreach ($data as $k => $value) {
if ($value->parent == $parent) {
$result[$value->id] = $value->name;
$data1 = Categorie::where('parent', '=', $value->id)->get();
foreach ($data1 as $value1) {
$id1 = $value1['id'];
$result[$id1] = "--" . $value1->name;
$data2 = Categorie::where('parent', '=', $value1->id)->get();
foreach ($data2 as $value2) {
$id2 = $value2['id'];
$result[$id2] = "-----" . $value2->name;
}
}
}
}
return $result;
}
开发者ID:minnb,项目名称:vitduct,代码行数:21,代码来源:Categorie.php
示例20: accessforbidden
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/treeview.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
$langs->load("categories");
if (!$user->rights->categorie->lire) {
accessforbidden();
}
$id = GETPOST('id', 'int');
$type = GETPOST('type') ? GETPOST('type') : Categorie::TYPE_PRODUCT;
$catname = GETPOST('catname', 'alpha');
$section = GETPOST('section') ? GETPOST('section') : 0;
/*
* View
*/
$categstatic = new Categorie($db);
$form = new Form($db);
if ($type == Categorie::TYPE_PRODUCT) {
$title = $langs->trans("ProductsCategoriesArea");
} elseif ($type == Categorie::TYPE_SUPPLIER) {
$title = $langs->trans("SuppliersCategoriesArea");
} elseif ($type == Categorie::TYPE_CUSTOMER) {
$title = $langs->trans("CustomersCategoriesArea");
} elseif ($type == Categorie::TYPE_MEMBER) {
$title = $langs->trans("MembersCategoriesArea");
} elseif ($type == Categorie::TYPE_CONTACT) {
$title = $langs->trans("ContactsCategoriesArea");
} else {
$title = $langs->trans("CategoriesArea");
}
$arrayofjs = array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
开发者ID:Samara94,项目名称:dolibarr,代码行数:31,代码来源:index.php
注:本文中的Categorie类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论