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


PHP Categorie类代码示例

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


在下文中一共展示了Categorie类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


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