Commit Graph

183 Commits

Author SHA1 Message Date
Will Rossiter
cf35533a78 EHANCHMENT: update the regular expression to disregard any underscores directly before a capital letter, as well as using the PCRE functions and adding a small test. PATCH: #4081
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77612 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-22 03:49:15 +00:00
Sean Harvey
e27f41238d API CHANGE Removed @deprecated 2.3 method DataObject::filledOut(): Please use custom code instead for checking values
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77379 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-20 06:22:33 +00:00
Ingo Schommer
4e8735b10e MINOR Marked new $create_table_options API as experimental
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77170 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-19 04:44:33 +00:00
Ingo Schommer
336bce8bf8 ENHANCEMENT Added DataObject::$create_table_options to pass through special options to Database->requireTable(). Contains a keyed array by database driver. Example use is specifying different storage engines for MySQL: array('MySQLDatabase'=>'ENGINE=InnoDB')
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77160 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-19 03:55:14 +00:00
Sean Harvey
161e7a35c7 Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77020 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-17 23:15:31 +00:00
Sean Harvey
9ff495188f MINOR Moved protected variables brokenOnWrite and brokenOnDelete to top of DataObject for consistency
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76607 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-12 01:58:45 +00:00
Sam Minnee
ed06eb37c0 BUGFIX: Created Versioned's Version field as a proper Dataobject field.
API CHANGE: DataObject's internal $this->record array doesn't import null values, so that they don't get written back out.
API CHANGE: DataObject queries explicitly list columns, rather than using *.  This means that extraneous columns won't be included.
MINOR: Updated tests for db abstraction.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76372 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-07 06:00:50 +00:00
Ingo Schommer
b4ec97506a BUGFIX Only loading value in a CompositeDBField through DataObject->getField() if either the value exists, or the record was previously saved
ENHANCEMENT Getting composite db field definitions in DataObject->hasOwnTableDatabaseField() when dealing with a CompositeDBField class

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76097 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-05 07:55:46 +00:00
Sean Harvey
13b358a8dd Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75582 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-04-29 00:07:39 +00:00
Sean Harvey
ec9765d9f2 Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75572 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-04-28 23:40:35 +00:00
Geoff Munn
3022c7a908 Removed Database Abstraction TODO notice
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75291 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-04-27 21:35:20 +00:00
Ingo Schommer
e55f3126fa BUGFIX Changed DataObject->newClassInstance() to only force changes if a differing classname was set. Setting ClassName property on new instance to trigger change detection (required for Translatable->onBeforeWrite())
BUGFIX Only force DataObject->forceChange() on fields which aren't already marked as changed

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75248 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-04-27 05:55:25 +00:00
Ingo Schommer
f5d578ff8c BUGFIX Setting Classname and RecordClassname properties on internal $record map when constructing a DataObject without passing $record into it. This ensures that getChangedFields() works on ClassName as well, which is required for Translatable->onBeforeWrite()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75156 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-04-27 01:36:15 +00:00
Ingo Schommer
d2d04d950a BUGFIX Consistently returning boolean values in DataObject->hasDatabaseField()
MINOR Documentation in DataObject

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73885 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-03-31 19:34:37 +00:00
Ingo Schommer
b12a00c391 MINOR phpdoc documentation
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73509 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-03-22 22:59:14 +00:00
Geoff Munn
e76d876b73 API CHANGE: Postgres support for T-search indexes
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73249 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-03-17 22:22:46 +00:00
Ingo Schommer
a2f6d82379 MINOR documentation
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73233 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-03-17 20:20:43 +00:00
Sam Minnee
41fb93b344 ENHANCEMENT #3032 ajshort: Use static methods for accessing static data
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73036 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-03-14 00:16:32 +00:00
Ingo Schommer
a97ee0e97d MINOR Documentation about database indexes
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@72976 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-03-12 11:11:35 +00:00
Geoff Munn
30cd13f0af BUG FIX: $basetable moved to avoid errors
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@72939 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-03-12 00:34:32 +00:00
Geoff Munn
cac97f9d78 API CHANGE: Auto-increment of ID column now DB-specific
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@72921 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-03-11 21:48:59 +00:00
Andrew O'Neil
635e2c3df6 Merged from 2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@72453 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-03-04 03:44:11 +00:00
Sean Harvey
fa4c42d642 ENHANCEMENT Allow auto setting a many-to-many relation on ComplexTableField in the similar fashion of auto setting the foreign key for a one-to-many or one-to-many relation.
ENHANCEMENT Added DataObject::many_many_extraFields() for getting the many_many_extraFields fields for a component name on both sides of a many-to-many relation.
MINOR Added test for many_many_extraFields in DataObjectTest



git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71613 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-10 06:04:36 +00:00
Sean Harvey
162a11350e MINOR Added code example for using DataObject::$many_many_extraFields
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71305 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-03 21:07:32 +00:00
Andrew O'Neil
60f75c5ca4 Merged changes from 2.3 branch
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71172 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-01 23:49:53 +00:00
Ingo Schommer
b7d394008e MINOR Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69957 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-10 11:35:50 +00:00
Ingo Schommer
fcda174ea2 BUGFIX Fixed DataObject->merge() behaviour when merging grandchildren classes of DataObject - was using customDatabaseFields() to merge only the db fields on specific class. Changed to inheritedDatabaseFields() and added unit test.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69801 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-07 01:25:43 +00:00
Ingo Schommer
085346f0e0 MINOR Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69704 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-05 06:19:48 +00:00
Ingo Schommer
bc430a96df ENHANCEMENT Added Versioned::get_versionnumber_by_stage() (used in new CMSMain/SiteTree state checking)
ENHANCEMENT Added Versioned->flushCache() to empty get_versionnumber_by_stage() caches
ENHANCEMENT Making DataObject->flushCache() decoratable

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69409 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-12-17 22:38:47 +00:00
Sam Minnee
a8dca3908e Static caching merges from dnc branch
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@68900 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-12-15 01:30:41 +00:00
Ingo Schommer
d26f08b481 MINOR merged branches/2.3 into trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@67465 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-12-04 22:38:32 +00:00
Sam Minnee
09e3145921 Fixed reading of booleans in postgres
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66432 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-23 23:49:25 +00:00
Sam Minnee
93438e0be2 API CHANGE: Adding double quotes to all table and field references (a work in progress)
API CHANGE: DataObject::get()'s GROUP BY clause is only generated for MySQL as it needs to be improved for other databases to accept it.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66427 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-23 23:28:16 +00:00
Sam Minnee
c7330dd231 Introduced array-based syntax for specifying field types (Merged branches/dbabs into trunk)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66403 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-23 01:01:03 +00:00
Sam Minnee
12e62c6329 ENHANCEMENT: Change MySQLDatabase connection to operate in ANSI SQL mode, to ease the transition to DB abstraction
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66399 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-22 03:51:04 +00:00
Sam Minnee
2984355f43 Merged branches/2.3 into trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66395 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-22 03:33:00 +00:00
Sam Minnee
5df7237a93 Fixed DataObject::hasDatabaseField() for built-in fields (Created, etc)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66110 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-18 01:49:29 +00:00
Sam Minnee
3d9532db83 Merged branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66108 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-18 01:48:37 +00:00
Will Rossiter
8052c5dce4 Merged pre-2.3-oct08 into trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66080 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-17 22:59:17 +00:00
Ingo Schommer
9c9a461d67 BUGFIX Removed project-specific hack in DataObject->getManyManyComponentsQuery() as it was breaking Translatable saving
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65518 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-10 02:36:21 +00:00
Ingo Schommer
137b76e271 API CHANGE Deprecated DataObjectDecorator->augmentBeforeWrite(), use DataObjectDecorator->onBeforeWrite()
API CHANGE Deprecated DataObjectDecorator->augmentPopulateDefaults(), use DataObjectDecorator->populateDefaults()
API CHANGE Deprecated DataObjectDecorator->augmentDefaultRecords(), use DataObjectDecorator->requireDefaultRecords()
API CHANGE Deprecated DataObjectDecorator->alternateCan(), use DataObjectDecorator->can()
API CHANGE Deprecated DataObjectDecorator->alternateCanAddChildren(), use DataObjectDecorator->canAddChildren()
API CHANGE Deprecated DataObjectDecorator->alternateCanView(), use DataObjectDecorator->canView()
API CHANGE Deprecated DataObjectDecorator->alternateCanDelete(), use DataObjectDecorator->canDelete()
API CHANGE Deprecated DataObjectDecorator->alternateCanEdit(), use DataObjectDecorator->canEdit()
API CHANGE Deprecated DataObjectDecorator->alternateCanCreate(), use DataObjectDecorator->canCreate()
ENHANCEMENT Added DataObject->onAfterDelete() and DataObjectDecorator->onAfterDelete()
ENHANCEMENT Added stub methods to DataObjectDecorator for documentation purposes

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65453 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-07 12:18:35 +00:00
Normann Lou
2b0add5c72 APICHANGE: make DataObject::getField() visible to the public
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65388 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-06 06:32:05 +00:00
Sam Minnee
c1d6e82248 API CHANGE: Removed manifest's dependency on database, by removing hastable information [17:47:04]
dquote> API CHANGE: Deprecate ClassInfo::ready() in favour of Security::database_is_ready()
dquote> API CHANGE: Create DataObject::has_own_table() to determine whether a DataObject has a table without looking at it.
dquote> API CHANGE: Exclude /tests/ directories from the manifest entirely except when tests are being run.
dquote> API CHANGE: Added ?usetestmanifest=1 flag to access the test manifest outside of test execution.
dquote> API CHANGE: Simplified Core.php manifest include to just call ManifestBuilder::include_manifest() - manifest takes care of its own cache file

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65385 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-06 04:51:25 +00:00
Sam Minnee
5f177b9f08 BUGFIX #2056: Removed all references to deprecated Member::isAdmin()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65232 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-04 23:31:33 +00:00
Sam Minnee
72d90ab270 Set default edit rights on pages to be only administrators
API CHANGE: Use return value of alternateCanPublish()
BUGFIX: Fixed the Link() value for homepage
BUGFIX: Allow DBField::__construct() without a name
API CAHNGE: Allow augmentPopulateDefaults on data object decorators

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65229 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-04 23:17:14 +00:00
Ingo Schommer
eb4c950655 BUGFIX Reverted auto-detection of i18n statics like $db in DataObject through provideI18nEntities() - was getting too complicated with decorated properties. Overload DataObject->fieldLabels() or DataObjectDecorator->updateFieldLabels() instead
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65071 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-02 20:01:49 +00:00
Ingo Schommer
09564b0132 API CHANGE Renamed DataObjectDecorator->loadExtraDBFields() to loadExtraStatics()
API CHANGE Renamed DataObjectDecorator->extraDBFields() to extraStatics()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65065 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-02 00:36:57 +00:00
Ingo Schommer
f06ae18409 API CHANGE Moved DataObject::get_by_url() to SiteTree::get_by_url()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65060 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-02 00:24:23 +00:00
Ingo Schommer
d19dd96793 API CHANGE Marked DataObject->filledOut() deprecated
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65059 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-02 00:17:39 +00:00
Ingo Schommer
d102a902b9 BUGFIX Collecting i18n entities for decorators separately from the decorated classes, as decorated properties like $db have to be stored in the module of the decorated, not in the module of the decorated class.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65057 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-01 23:16:45 +00:00