本文整理汇总了PHP中Entry::loadFromRow方法的典型用法代码示例。如果您正苦于以下问题:PHP Entry::loadFromRow方法的具体用法?PHP Entry::loadFromRow怎么用?PHP Entry::loadFromRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entry
的用法示例。
在下文中一共展示了Entry::loadFromRow方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadFromRow
/**
* @param \stdClass $row
*/
public function loadFromRow(\stdClass $row)
{
parent::loadFromRow($row);
$this->setAmount($row->amount)->setUrl($row->url)->setPosition($row->position)->setLocalPosition($row->local_position)->setLevel($row->level)->setLocalFirstName($row->local_first_name)->setLocalLastName($row->local_last_name)->setLocalAddress($row->local_address)->setLocalCity($row->local_city)->setLocalState($row->local_state)->setLocalZip($row->local_zip)->setLocalPhone($row->local_phone)->setLocalEmail($row->local_email);
}
示例2: loadFromRow
/**
* @param \stdClass $row
*/
public function loadFromRow(\stdClass $row)
{
parent::loadFromRow($row);
$this->setDonationAmount($row->donation_amount);
}
示例3: exportToCsv
public static function exportToCsv()
{
global $wpdb;
$tables = array(CruiseEntry::TABLE_NAME => 'cruise', FestivalEntry::TABLE_NAME => 'festival', MurderMysteryEntry::TABLE_NAME => 'murder-mystery', ParadeEntry::TABLE_NAME => 'parade', Donation::TABLE_NAME => 'donation', FlagHandle::TABLE_NAME => 'flag-handle', Sponsorship::TABLE_NAME => 'sponsorship');
$year = isset($_POST['pride_export']) && is_numeric($_POST['pride_export']) ? abs(round($_POST['pride_export'])) : NULL;
$table = isset($_POST['table']) && array_key_exists($_POST['table'], $tables) ? $_POST['table'] : NULL;
header('Content-type: text/csv');
if ($table === NULL) {
header('Content-disposition: attachment;filename=export.csv');
echo 'No Data to Export';
} else {
header('Content-disposition: attachment;filename=' . ($year !== NULL ? $year : 'all') . '-' . $tables[$table] . '-entries.csv');
echo "Entry Date,Entry Year,Organization,First Name,Last Name,Email,Phone,Address,City,State,Zip,";
switch ($table) {
case FestivalEntry::TABLE_NAME:
echo "Entry Type,Corner Booth,";
break;
case MurderMysteryEntry::TABLE_NAME:
echo "Upgraded Meal,Vegetarian Count,Entry Type,";
break;
case ParadeEntry::TABLE_NAME:
echo "Entry Types,Description,Parking Spots,Amped Sound,Group Size,Donation,";
break;
case Donation::TABLE_NAME:
echo "Donation,";
break;
case FlagHandle::TABLE_NAME:
echo "Message,Color,";
break;
}
echo "Qty,Amount Due,Amount Paid,Payment Method,Paid On,Notes";
$rows = $wpdb->get_results("\n\t\t\t\tSELECT\n\t\t\t\t\t*\n\t\t\t\tFROM\n\t\t\t\t\t" . $wpdb->prefix . $table . "\n\t\t\t\tWHERE\n\t\t\t\t\tentry_year " . ($year === NULL ? " > 0 " : " = " . $year) . "\n\t\t\t\tORDER BY\n\t\t\t\t\tid ASC");
if ($rows) {
foreach ($rows as $row) {
switch ($table) {
case CruiseEntry::TABLE_NAME:
$entry = new CruiseEntry();
break;
case FestivalEntry::TABLE_NAME:
$entry = new FestivalEntry();
break;
case MurderMysteryEntry::TABLE_NAME:
$entry = new MurderMysteryEntry();
break;
case ParadeEntry::TABLE_NAME:
$entry = new ParadeEntry();
break;
case Donation::TABLE_NAME:
$entry = new Donation();
break;
case FlagHandle::TABLE_NAME:
$entry = new FlagHandle();
break;
case Sponsorship::TABLE_NAME:
$entry = new Sponsorship();
break;
default:
$entry = new Entry();
}
$entry->loadFromRow($row);
echo "\r\n";
echo $entry->getCreatedAt('n/j/Y') . ',';
echo $entry->getEntryYear() . ',';
echo '"' . str_replace('"', '""', $entry->getOrganization()) . '",';
echo '"' . str_replace('"', '""', $entry->getFirstName()) . '",';
echo '"' . str_replace('"', '""', $entry->getLastName()) . '",';
echo '"' . str_replace('"', '""', $entry->getEmail()) . '",';
echo '"' . str_replace('"', '""', $entry->getPhone()) . '",';
echo '"' . str_replace('"', '""', $entry->getAddress()) . '",';
echo '"' . str_replace('"', '""', $entry->getCity()) . '",';
echo '"' . str_replace('"', '""', $entry->getState()) . '",';
echo '"' . str_replace('"', '""', $entry->getZip()) . '",';
switch ($table) {
case FestivalEntry::TABLE_NAME:
echo '"' . str_replace('"', '""', $entry->getEntryType()) . '",';
echo ($entry->isCornerBooth() ? 'Y' : 'N') . ',';
break;
case MurderMysteryEntry::TABLE_NAME:
echo ($entry->isUpgraded() ? 'Y' : 'N') . ',';
echo $entry->getVegetarianQty() . ',';
echo ($entry->isSponsor() ? 'Table' : 'Ticket') . ',';
break;
case ParadeEntry::TABLE_NAME:
echo '"' . str_replace('"', '""', implode(',', $entry->getEntryTypes())) . '",';
echo '"' . str_replace("\n", ' ', str_replace("\r", ' ', str_replace('"', '""', $entry->getDescription()))) . '",';
echo $entry->getFloatParkingSpaces() . ',';
echo ($entry->needsAmpedSound() ? 'Y' : 'N') . ',';
echo $entry->getGroupSize() . ',';
echo $entry->getDonationAmount() . ',';
break;
case Donation::TABLE_NAME:
echo $entry->getDonationAmount() . ',';
break;
case FlagHandle::TABLE_NAME:
echo '"' . str_replace("\n", ' ', str_replace("\r", ' ', str_replace('"', '""', $entry->getMessage()))) . '",';
echo '"' . str_replace("\n", ' ', str_replace("\r", ' ', str_replace('"', '""', $entry->getColor()))) . '",';
break;
}
echo $entry->getQty() . ',';
echo $entry->getTotal() . ',';
//.........这里部分代码省略.........
示例4: loadFromRow
/**
* @param \stdClass $row
*/
public function loadFromRow(\stdClass $row)
{
parent::loadFromRow($row);
$this->setMessage($row->message)->setColor($row->color);
}
示例5: loadFromRow
/**
* @param \stdClass $row
*/
public function loadFromRow(\stdClass $row)
{
parent::loadFromRow($row);
$this->setIsSponsor($row->is_sponsor)->setIsUpgraded($row->is_upgraded)->setVegetarianQty($row->vegetarian_qty)->setTicketsSent($row->tickets_sent);
}
示例6: loadFromRow
/**
* @param \stdClass $row
*/
public function loadFromRow(\stdClass $row)
{
parent::loadFromRow($row);
$this->setTicketsSent($row->tickets_sent);
}
示例7: loadFromRow
/**
* @param \stdClass $row
*/
public function loadFromRow(\stdClass $row)
{
parent::loadFromRow($row);
$this->setEntryTypes($row->entry_types)->setNeedsAmpedSound($row->needs_amped_sound)->setGroupSize($row->group_size)->setFloatParkingSpaces($row->float_parking_spaces)->setFloatParkingSpaceCost($row->float_parking_space_cost)->setDonationAmount($row->donation_amount)->setDescription($row->description);
}
示例8: loadFromRow
/**
* @param \stdClass $row
*/
public function loadFromRow(\stdClass $row)
{
parent::loadFromRow($row);
$this->setEntryTypeId($row->entry_type_id)->setIsCornerBooth($row->is_corner_booth)->setPriceForCornerBooth($row->price_for_corner_booth)->setDescription($row->description);
}