本文整理匯總了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];
}
}
示例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];
}
示例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'));