Fixed OneToMany populate attachment

Signed-off-by: Tom Wright <tom@inflatablecookie.com>
Make db statements countable
Cache query total if less than limit

Signed-off-by: Tom Wright <tom@inflatablecookie.com>
Fix many relation field populating

Signed-off-by: Tom Wright <tom@inflatablecookie.com>
Fixed PDO statement counter

Signed-off-by: Tom Wright <tom@inflatablecookie.com>
Added fetchEntityForAction to data helper

Signed-off-by: Tom Wright <tom@inflatablecookie.com>