本文整理汇总了PHP中Story::getFieldsArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Story::getFieldsArray方法的具体用法?PHP Story::getFieldsArray怎么用?PHP Story::getFieldsArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Story
的用法示例。
在下文中一共展示了Story::getFieldsArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$t->is($post->getUniqueId(), $identifier);
// @Test: getFieldsArray() generates an array with all the required fields
$keys = array_keys($post->getFieldsArray());
$t->is_deeply($keys, array('sf_unique_id', 'sf_meta_class', 'sf_meta_id', 'title_t', 'body_t'));
// @Test: getFieldsArray() generates an array with correct values
$array = $post->getFieldsArray();
$t->is($array['sf_meta_class']['value'], 'Post');
$t->is($array['sf_meta_id']['value'], $post->getId());
$t->is($array['title_t']['value'], 'title');
$t->is($array['body_t']['value'], 'body');
// @Test: deleteIndex() calls the deleteAllFromClass handler function
$handler->deleteAllFromClass('Post')->once();
$handler->commit()->once();
$handler->replay();
Doctrine::getTable('Post')->deleteIndex();
$handler->verify();
// @Test: createSearchQuery returns a Doctrine_Query object
$results = array('response' => array('docs' => array(0 => array('sf_meta_id' => 1), 3 => array('sf_meta_id' => 2), 2 => array('sf_meta_id' => 3))));
$handler->any('search')->returns($results);
$handler->replay();
$q = Doctrine::getTable('Post')->createSearchQuery('azerty');
$t->ok($q instanceof Doctrine_Query);
// @Test: I18n integration
$story = new Story();
$story->slug = 'toto';
$story->Translation['fr']->body = 'Mon histoire';
$story->Translation['en']->body = 'My story';
$story->save();
$fields = $story->getFieldsArray();
$t->ok(array_key_exists('body_fr', $fields));
$t->ok(array_key_exists('body_en', $fields));