Guest User

Untitled

a guest
Oct 18th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. /**
  2. * @todo.
  3. */
  4. public function pack($exportable) {
  5. $data = array();
  6.  
  7. foreach ($this->schema['fields'] as $field => $info) {
  8. if (isset($exportable->{$field})) {
  9. $data[$field] = $exportable->{$field};
  10. }
  11. else {
  12. $data[$field] = !empty($info['default']) ? $info['default'] : NULL;
  13. }
  14. }
  15.  
  16. return $data;
  17. }
Add Comment
Please, Sign In to add comment