Setting values in PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alter
    Member
    • Apr 2018
    • 57

    Setting values in PHP

    Hello,

    how can I set values of fields in entity using PHP? I don't know what .php file should I write functions to. Entity.php in /Entities, or /Repositories?

    And also, is this correct ? Thank you.

    public function setValue(Entity $entity) {
    $name->$entity->get('name');
    $entity->set('editor', $name);
    }
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    https://github.com/espocrm/espocrm/b...ities/Lead.php an example

    Your method could be workable, if you fix 2nd row
    $name = $entity->get('name');

    But you need to call this method somewhere

    Comment

    Working...