本文整理汇总了PHP中License::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP License::insert方法的具体用法?PHP License::insert怎么用?PHP License::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类License
的用法示例。
在下文中一共展示了License::insert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
// Initialize empty array
$license = array();
$date = new DateTime();
$license[] = array('name' => 'Adobe Photoshop CS6', 'serial' => 'ZOMG-WtF-BBQ-SRSLY', 'purchase_date' => '2013-10-02', 'purchase_cost' => '2435.99', 'purchase_order' => '1', 'maintained' => '0', 'order_number' => '987698576946', 'created_at' => $date->modify('-10 day'), 'updated_at' => $date->modify('-3 day'), 'seats' => 5, 'license_name' => '', 'license_email' => '', 'notes' => '', 'user_id' => 1, 'depreciation_id' => 2, 'deleted_at' => NULL, 'depreciate' => '0');
$license[] = array('name' => 'Git Tower', 'serial' => '98049890394-340485934', 'purchase_date' => '2013-10-02', 'purchase_cost' => '2435.99', 'purchase_order' => '1', 'maintained' => '1', 'order_number' => '987698576946', 'created_at' => $date->modify('-10 day'), 'updated_at' => $date->modify('-3 day'), 'seats' => 2, 'license_name' => 'Alison Gianotto', 'license_email' => 'snipe@snipe.net', 'notes' => '', 'user_id' => 1, 'depreciation_id' => 2, 'deleted_at' => NULL, 'depreciate' => '0');
// Delete all the old data
DB::table('licenses')->truncate();
// Insert the new posts
License::insert($license);
}
示例2: License
$l->software($datas['logiciel']);
$l->admin(true);
}
//Insert "other" keys
$iter = XDB::iterator('SELECT logiciel, cle, eleve_id, binet_id
FROM msdnaa.cles_autres');
while ($datas = $iter->next()) {
$l = new License();
$l->insert();
$l->key($datas['cle']);
$l->software($datas['logiciel']);
if ($datas['eleve_id']) {
$l->uid($datas['eleve_id']);
}
if ($datas['binet_id']) {
$l->gid($datas['binet_id']);
}
}
//Insert unregistred user keys
$iter = XDB::iterator('SELECT logiciel, cle, prenom, nom, statut, mail
FROM msdnaa.cles_unregistered_users');
while ($datas = $iter->next()) {
$l = new License();
$l->insert();
$l->key($datas['cle']);
$l->software($datas['logiciel']);
$l->uid(0);
$l->comments("Key given to " . $datas['prenom'] . " " . $datas['nom'] . " (" . $datas['statut'] . ") " . $datas['mail']);
}
echo "Done \n";
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: