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


PHP Properties::create方法代碼示例

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


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

示例1: run

 public function run()
 {
     $faker = Faker\Factory::create();
     foreach (range(1, 20) as $index) {
         Properties::create(['serialno' => '123abc', 'propname' => $faker->firstName, 'propdesc' => 'Lorem ipsum dolor sit amet', 'propstatus' => 'In stock', 'propcondition' => 'Good', 'prop_category' => $faker->numberBetween($min = 1, $max = 5), 'propcost' => $faker->randomFloat(NULL, 500, 35000), 'dateacq' => $faker->dateTimeBetween('-10 years', '-1 year')->format('Y-m-d')]);
     }
 }
開發者ID:codeblues1516,項目名稱:godaddy,代碼行數:7,代碼來源:PropertiesTableSeeder.php

示例2: postAddProperty

 public function postAddProperty()
 {
     $validator = Validator::make(Input::all(), Properties::$rules, Properties::$errmsgs);
     if ($validator->fails()) {
         return Redirect::route('addproperty')->withErrors($validator)->withInput();
     }
     $prop = Properties::create(['serialno' => Input::get('serialno'), 'propname' => Input::get('propname'), 'propdesc' => Input::get('propdesc'), 'propcondition' => 'Good', 'propstatus' => 'In stock', 'prop_category' => Input::get('category'), 'propcost' => Input::get('propcost'), 'dateacq' => Input::get('dateacq')]);
     $lastid = Properties::orderBy('id', 'desc')->first();
     $audit = AuditTrail::create(['user_id' => Auth::id(), 'role' => 'Property Management Admin', 'action' => 'added a new property "' . $lastid->propname . '" with an ID of ' . $lastid->id . '.']);
     return Redirect::route('addproperty')->with('alert', 'success|Property has been successfully added.');
 }
開發者ID:codeblues1516,項目名稱:godaddy,代碼行數:11,代碼來源:PropertyController.php

示例3: testGetKeysWithSections

 /**
  * This test tries to load the keys of sectioned
  * property file.
  *
  * @return void
  */
 public function testGetKeysWithSections()
 {
     // initialize and load the stored property file
     $properties = Properties::create();
     $properties->load(__DIR__ . '/test.with.sections.properties', true);
     // load the keys
     $keys = $properties->getKeys();
     // check the expected keys
     $this->assertTrue(in_array('property.key.01', $keys));
     $this->assertTrue(in_array('property.key.02', $keys));
     $this->assertTrue(in_array('property.key.03', $keys));
     $this->assertTrue(in_array('property.key.04', $keys));
 }
開發者ID:techdivision,項目名稱:properties,代碼行數:19,代碼來源:PropertiesTest.php

示例4: array

        }
    }
}
$core_names = array('courier' => 'Courier', 'courierB' => 'Courier-Bold', 'courierI' => 'Courier-Oblique', 'courierBI' => 'Courier-BoldOblique', 'helvetica' => 'Helvetica', 'helveticaB' => 'Helvetica-Bold', 'helveticaI' => 'Helvetica-Oblique', 'helveticaBI' => 'Helvetica-BoldOblique', 'times' => 'Times-Roman', 'timesB' => 'Times-Bold', 'timesI' => 'Times-Italic', 'timesBI' => 'Times-BoldItalic', 'symbol' => 'Symbol', 'zapfdingbats' => 'ZapfDingbats');
// Kommandozeilen-Parameter
$param = new ParamString($_SERVER['argv']);
$search = $param->exists('search') ? $param->value('search') : './src/font/.*';
$propertyFile = $param->exists('conf') ? $param->value('conf') : 'core_fonts.ini';
$pattern = basename($search);
$base = dirname($search);
printf("===> Start for %s [allfiles %s]\n", $base, $pattern);
$prop = new Properties($propertyFile);
if (!$prop->exists()) {
    try {
        printf("---> Creating configfile %s\n", $propertyFile);
        $prop->create();
    } catch (IOException $e) {
        $e->printStackTrace();
        exit;
    }
}
// Verzeichnis durchsuchen
$d = new Folder($base);
while ($e = $d->getEntry()) {
    if (is_dir($d->uri . '/' . $e) || !preg_match('/' . $pattern . '/', $e)) {
        continue;
    }
    printf("---> Saving fontdef for %s to %s\n", $e, $propertyFile);
    writeFontDef($d->uri . '/' . $e, $prop);
}
$d->close();
開發者ID:Gamepay,項目名稱:xp-contrib,代碼行數:31,代碼來源:migrate_fonts.php


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