当前位置: 首页>>代码示例>>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;未经允许,请勿转载。