本文整理汇总了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'));