Getting field value from within PHP editor constructor
Getting field value from within PHP editor constructor
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
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
Hi Allan, yes that's what I'm looking for. I solved storing the value in a $_SESSION variable.
Franco