Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Documentation (from r104767)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112379 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit 0b6feffd4c076c446dfd2022b13825070e89acb4 1 parent 1f3a067
@chillu chillu authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 core/model/DataObject.php
View
7 core/model/DataObject.php
@@ -1285,6 +1285,9 @@ public function getComponent($componentName) {
/**
* Returns a one-to-many component, as a ComponentSet.
+ * The return value will be cached on this object instance,
+ * but only when no related objects are found (to avoid unnecessary empty checks in the database).
+ * If related objects exist, no caching is applied.
*
* @param string $componentName Name of the component
* @param string $filter A filter to be inserted into the WHERE clause
@@ -1398,6 +1401,10 @@ public function setComponent($componentName, $componentValue) {
/**
* Returns a many-to-many component, as a ComponentSet.
+ * The return value will be cached on this object instance,
+ * but only when no related objects are found (to avoid unnecessary empty checks in the database).
+ * If related objects exist, no caching is applied.
+ *
* @param string $componentName Name of the many-many component
* @return ComponentSet The set of components
*
Please sign in to comment.
Something went wrong with that request. Please try again.