organization_name in apiv4 - query
I just created a test which retrieves contributions and then checks them against expected. Note that my contact is an individual and the employer_name is stored in the organization_name field for individuals
$expected = $this->getExpected();
$contributions = Contribution::get(FALSE)->addWhere('trxn_id', 'LIKE', 'Daf%')
->setSelect(array_keys($expected[0]))
->addOrderBy('id')
->addJoin('ContributionSoft AS contribution_soft', 'LEFT')
->addJoin('Contact AS contact_soft', 'LEFT', NULL, ['contact_soft.id', '=', 'contribution_soft.contact_id'])
->execute();
foreach ($contributions as $index => $values) {
unset($values['id']);
$this->assertEquals($expected[$index], $values);
}
However, oddly, I had to refer to organization_name differently than I did all the other fields to get it to return (5.39rc)
@colemanw another question...