public function test_field_construction() { $resource = $this->buildFakeResource(); $field = new Field($resource, 'myCoolField', 'my_cool_field', Field::TYPE_DATE, 'd-M-Y'); $this->assertEquals($resource, $field->getResource()); $this->assertEquals('myCoolField', $field->getAlias()); $this->assertEquals('my_cool_field', $field->getName()); $this->assertEquals(Field::TYPE_DATE, $field->getType()); $this->assertEquals('d-M-Y', $field->getFormatString()); }
private function buildSelectFieldClause(Field $field) { $resource = $field->getResource(); return $resource->getResourceUniqueIdentifier() . '.' . $field->getName() . ' as ' . $resource->getResourceUniqueIdentifier() . '_' . $field->getAlias(); }