Advertisement:

Author Topic: Where is data function?  (Read 166 times)

Xefiron

  • Newbie
  • *
  • Posts: 32
  • Software developer - Desarrollador de software
Where is data function?
« on: April 08, 2019, 08:47:15 pm »
Inside the file ItemActions.php in the line #61 i found add() function, but i dont understand the next lines of code:

Code: [Select]
$aItem       = $this->data;
The reason?, this class doesn't extended from another class and I can't found a data function inside this class. ¿What is the data function?

WEBmods

  • Hero Member
  • *****
  • Posts: 937
  • github.com/webmods-croatia/love-osclass/ | patrick
Re: Where is data function?
« Reply #1 on: April 08, 2019, 10:43:08 pm »
Hello,

"data" is a variable. Function/method will have "()" or "($variables)".
When posting or editing an item, all data is gathered and verified and saved in $data variable of the class:

Code: [Select]
            $aItem = osc_apply_filter('item_prepare_data', $aItem);
            $this->data = $aItem;

Regards.

Xefiron

  • Newbie
  • *
  • Posts: 32
  • Software developer - Desarrollador de software
Re: Where is data function?
« Reply #2 on: April 09, 2019, 08:48:36 pm »
So it was a variable, I guess it makes more sense. Thanks for your reply.