diff options
author | cash <cash.costello@gmail.com> | 2013-03-16 12:41:16 -0400 |
---|---|---|
committer | cash <cash.costello@gmail.com> | 2013-03-16 12:41:16 -0400 |
commit | 00819122111a081c17f1ae4c53974b0deb50757c (patch) | |
tree | 7b031dcce924a8f006d4ed70abd12662862d4867 /engine/classes/ElggAttributeLoader.php | |
parent | ea4ce20b3632a3c55ffedfad1ad53845db5a7e12 (diff) | |
download | elgg-00819122111a081c17f1ae4c53974b0deb50757c.tar.gz elgg-00819122111a081c17f1ae4c53974b0deb50757c.tar.bz2 |
more coding standard fixes
Diffstat (limited to 'engine/classes/ElggAttributeLoader.php')
-rw-r--r-- | engine/classes/ElggAttributeLoader.php | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/engine/classes/ElggAttributeLoader.php b/engine/classes/ElggAttributeLoader.php index 2d1c1abde..d1e15008e 100644 --- a/engine/classes/ElggAttributeLoader.php +++ b/engine/classes/ElggAttributeLoader.php @@ -4,6 +4,9 @@ * Loads ElggEntity attributes from DB or validates those passed in via constructor * * @access private + * + * @package Elgg.Core + * @subpackage DataModel */ class ElggAttributeLoader { @@ -65,9 +68,11 @@ class ElggAttributeLoader { public $full_loader = ''; /** - * @param string $class class of object being loaded - * @param string $required_type entity type this is being used to populate - * @param array $initialized_attrs attributes after initializeAttributes() has been run + * Constructor + * + * @param string $class class of object being loaded + * @param string $required_type entity type this is being used to populate + * @param array $initialized_attrs attributes after initializeAttributes() has been run * @throws InvalidArgumentException */ public function __construct($class, $required_type, array $initialized_attrs) { @@ -87,14 +92,33 @@ class ElggAttributeLoader { $this->secondary_attr_names = array_diff($all_attr_names, self::$primary_attr_names); } + /** + * Get primary attributes missing that are missing + * + * @param stdClass $row Database row + * @return array + */ protected function isMissingPrimaries($row) { return array_diff(self::$primary_attr_names, array_keys($row)) !== array(); } + /** + * Get secondary attributes that are missing + * + * @param stdClass $row Database row + * @return array + */ protected function isMissingSecondaries($row) { return array_diff($this->secondary_attr_names, array_keys($row)) !== array(); } + /** + * Check that the type is correct + * + * @param stdClass $row Database row + * @return void + * @throws InvalidClassException + */ protected function checkType($row) { if ($row['type'] !== $this->required_type) { $msg = elgg_echo('InvalidClassException:NotValidElggStar', array($row['guid'], $this->class)); |