本文整理汇总了PHP中ca_objects::prepopulateFields方法的典型用法代码示例。如果您正苦于以下问题:PHP ca_objects::prepopulateFields方法的具体用法?PHP ca_objects::prepopulateFields怎么用?PHP ca_objects::prepopulateFields使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca_objects
的用法示例。
在下文中一共展示了ca_objects::prepopulateFields方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testPrepopulateFieldsOverwriteContainer
public function testPrepopulateFieldsOverwriteContainer()
{
// load config
$va_prepopulate_options = array('prepopulateConfig' => dirname(__FILE__) . DIRECTORY_SEPARATOR . 'conf' . DIRECTORY_SEPARATOR . 'prepopulate_container_overwrite.conf');
$t_object = new ca_objects();
$t_object->setMode(ACCESS_WRITE);
$t_object->set('type_id', 'image');
$t_object->set('idno', 'test123');
$t_object->addAttribute(array('url_entry' => "http://en.wikipedia.org", 'url_source' => 'Wikipedia'), 'external_link');
$t_object->insert();
$this->assertGreaterThan(0, $t_object->getPrimaryKey(), 'Primary key for new object must be greater than 0');
$this->opa_test_record_ids['ca_objects'][] = $t_object->getPrimaryKey();
$this->assertTrue($t_object->prepopulateFields($va_prepopulate_options), 'Prepopulate should return true');
$this->assertEquals('test123', $t_object->get('ca_objects.external_link.url_source'), 'url source must prepopulate');
$this->assertEquals("http://en.wikipedia.org", $t_object->get('ca_objects.external_link.url_entry'), 'url entry must not change');
}