當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Preference::find_all方法代碼示例

本文整理匯總了PHP中Preference::find_all方法的典型用法代碼示例。如果您正苦於以下問題:PHP Preference::find_all方法的具體用法?PHP Preference::find_all怎麽用?PHP Preference::find_all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Preference的用法示例。


在下文中一共展示了Preference::find_all方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Preference

 function read_prefs()
 {
     if (!isset($this->preference)) {
         $preference_factory = new Preference();
         $preferences = $preference_factory->find_all();
         $this->preference = $preferences[0];
     }
 }
開發者ID:emeraldion,項目名稱:creso,代碼行數:8,代碼來源:creso_controller.php

示例2: index

 function index()
 {
     if ($this->request->is_post()) {
         $preference = new Preference($_POST);
         $preference->save();
     }
     $preference_factory = new Preference();
     $preferences = $preference_factory->find_all();
     $this->preference = $preferences[0];
 }
開發者ID:emeraldion,項目名稱:creso,代碼行數:10,代碼來源:preferences_controller.php

示例3: populate_cedole

#!/usr/bin/php
<?php 
ini_set('max_execution_time', 3000);
require_once dirname(__FILE__) . "/lib.inc.php";
require_once dirname(__FILE__) . "/../include/db.inc.php";
require_once dirname(__FILE__) . "/../include/" . DB_ADAPTER . "_adapter.php";
require_once dirname(__FILE__) . "/../models/preference.php";
require_once dirname(__FILE__) . "/../models/bond.php";
require_once dirname(__FILE__) . "/../models/cedola.php";
date_default_timezone_set('Europe/Rome');
echo "Reading preferences...";
$preference_factory = new Preference();
$preferences = $preference_factory->find_all()[0];
// print_r($preferences);
echo "done\n";
function populate_cedole()
{
    $bond_factory = new Bond();
    $today = date('Y-m-d');
    // $bonds = $bond_factory->find_all(array('where_clause' => "`stacco` != '0000-00-00' AND `cadenza` > 0 AND `scadenza` > '{$today}'"));
    $bonds = $bond_factory->find_all(array('where_clause' => "`cadenza` > 0 AND `scadenza` > '{$today}'"));
    // print_r($bonds);
    foreach ($bonds as $bond) {
        if ($bond->stacco != '0000-00-00') {
            $s = strtotime($bond->stacco);
            $k = 1;
        } else {
            $s = strtotime($bond->scadenza);
            $k = -1;
        }
        $d = $today = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
開發者ID:emeraldion,項目名稱:creso,代碼行數:31,代碼來源:populate_cedole.php


注:本文中的Preference::find_all方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。