Getting field value from within PHP editor constructor

Getting field value from within PHP editor constructor

f.talamini@stmingegneria.euf.talamini@stmingegneria.eu Posts: 23Questions: 11Answers: 0

I was wondering if I can access field values while defining fields:
in PHP:
Editor::inst()
->fields( Field::inst( 'Field1') -> options( Options::inst()
->->table(...' )
->value( 'matricola' )
->label( 'Matricola')
->where( function($q) {
$q->where('matricola',query(:idLett, :idUn, :curm),'IN',false );
$q->bind(":idLett",$_SESSION['idLetture']);
$q->bind(":idUn",$_SESSION['idUnita']);
$q->bind(":curm", FieldOriginalValue('Field1'));
}) ),
)
-> where....

Does such a way of getting field values as FieldOriginalValue('Field1') exists?
Thank you,
Regards,
Franco

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin
    Answer ✓

    Hi Franco,

    I'm not sure I 100% understand I'm afraid. It sounds like you want a unique where condition for every row, based on the content of that row? If so, I'm afraid that's not something that Editor can do at the moment. I'm not even sure how you would do that in SQL unless you stored the original value somewhere.

    Allan

  • f.talamini@stmingegneria.euf.talamini@stmingegneria.eu Posts: 23Questions: 11Answers: 0

    Hi Allan, yes that's what I'm looking for. I solved storing the value in a $_SESSION variable.

    Franco

This discussion has been closed.