HomePhorge

Load only valid properties in LiskDAO::loadFromArray()

Description

Load only valid properties in LiskDAO::loadFromArray()

Summary:
Fixes a TODO, and silences a warning introduced by D3601.

There are several cases where we load data like:

SELECT *, ... AS extraData FROM ...

...and then pass it to loadAllFromArray(). Currently, this causes us to set an extraData property on the object.

This idiom seems fairly useful and non-dangerous, so I made loadFromArray() just drop extra keys.

Since we hit this loop a potentially huge number of times (10,000+ for full Maniphest pages) I did some microoptimization. Lisk is hot enough that it's one of the few places where it's worthwhile (see D1291).

Test Plan: Loaded homepage, no longer got warnings about viewerIsMember from Project queries. Browsed ~10 apps, didn't see any issues.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3606

Details

Provenance
epriestleyAuthored on Oct 3 2012, 3:42 PM
themackabuPushed on Mar 25 2025, 8:07 PM
Parents
rP270256d3363b: Restore flavor text to applications
Branches
Unknown
Tags
Unknown

Event Timeline