本文整理匯總了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();