本文整理汇总了PHP中Property::withTL方法的典型用法代码示例。如果您正苦于以下问题:PHP Property::withTL方法的具体用法?PHP Property::withTL怎么用?PHP Property::withTL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Property
的用法示例。
在下文中一共展示了Property::withTL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: withTL_AUTO
public static function withTL_AUTO($name, $type, $length)
{
$instance = Property::withTL($name, $type, $length);
$instance->auto_incrementing = true;
return $instance;
}
示例2:
<?php
include_once '../src/Account.php';
include_once '../src/Database.php';
include_once '../src/Table.php';
include_once '../src/Property.php';
include_once '../src/properties/Type.php';
include_once '../src/properties/Index.php';
$account = Account::withHost('127.0.0.1', 'root', '');
$database = Database::withAccount($account, 'test');
$table = Table::withDatabase($database, 'test3');
echo 'DROPPED: ' . $table->drop() . "<BR>";
$table->properties = [Property::withTL_AUTO_INDEX('ID', Type::INT, 10, Index::PRIMARY), Property::withTL('NAME', Type::VARCHAR, 25)];
echo 'CREATED: ' . $table->create() . '<BR>';
echo 'ADDED: ' . $table->addRow(['ID' => 3, 'NAME' => 'Mexican']) . '<BR>';
echo 'GET ROW: ' . $table->getRow(['ID' => 3])['NAME'];
$table2 = Table::withDatabase($database, 'test4');
$table2->drop();
$table2->properties = [Property::withTL_AUTO_INDEX('ID', Type::INT, 10, Index::PRIMARY)->addForeign('ID', 'test3')];
$table2->create();