SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class ProductHelper {
  2.  
  3.     public getAllAttributeValues(Product product): array
  4.     { return ['attribute1' => 'value1', 'attribute2' => ['tag1', 'tag2'], ...}
  5.  
  6.     getOptionalAttributeValues(Product product): array //why?
  7.     { return ['key' => ['value',..], ...] }
  8.  
  9.     public getAttributeValueScalar(Product product, String attributeName, String delimiter): string
  10.     {
  11. return  'tag1, tag2'; //or
  12. return 'value';
  13. }
  14.     public getAttributeValueArray(Product product, String attributeName): array
  15.     {
  16. return  ['tag1', 'tag2']; //or
  17. return ['value'];
  18. }
  19.  
  20.     getOneOptionalAttribute(Product product) //why?
  21.     { return ['key' => ['value',..]] }
  22.  
  23.     public getAnyAttribute(Product product, array attributes) //is there a use case?
  24.     { return ['key' => value, ...] }
  25.  
  26.     getAnyOptionalAttribute(Product product, array attributes) //why?
  27.     { return ['key' => ['value',..], ...] }
  28.  
  29.     getOptinalAttributeAsString(Product product, String delimiter) //see above
  30.     { return attribute . delimeter . ... }
  31.    
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top