/** * {@inheritdoc} */ public function buildGrid(Grid $grid, Schema $schema, Collection $collection, array $options = array()) { if ($options[self::NAME]) { $schema->build($row = new Row(self::NAME), null, $options); $grid->getHead()->add(self::NAME, $row); } }
/** * {@inheritdoc} */ public function buildGrid(Grid $grid, Schema $schema, Collection $collection, array $options = array()) { $index = 0; while ($entity = $collection->next()) { $schema->build($row = new Row(self::NAME), $entity, $options); $grid->getBody()->add($entity->getId() ?: $index++, $row); } }
public function testRemoveColumn() { $schema = Schema::create()->add('id', 'number')->add('name', 'string'); $this->assertTrue($schema->has('id')); $schema->remove('id'); $this->assertFalse($schema->has('id')); }
/** * {@inheritdoc} */ public function buildSchema(Schema $schema, Collection $collection, array $options = array()) { if ($options[self::NAME]->isEnabled()) { $schema->add('.' . self::NAME, self::NAME, array(self::NAME => $options[self::NAME])); } }
public static function getBeatlesSchema() { return Schema::create()->add('name', 'string')->add('birthday', 'datetime', array('time_format' => \IntlDateFormatter::NONE))->add('alive', 'boolean', array('true_value' => 'yes :)', 'false_value' => 'no :(')); }