Title: Entity binding in PHP code
Last modified: January 15, 2019

---

# Entity binding in PHP code

 *  Resolved [okayaelectric](https://wordpress.org/support/users/okayaelectric/)
 * (@okayaelectric)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/entity-binding-in-php-code/)
 * Am attempting to use data from 365 to override the title and meta description
   fields for our SEO plugin.
 * The page is called product-detail and I have it bound to the Product entity from
   365.
 * I am using this from the documentation to create the WordPress filter in functions.
   php — have copy/pasted and just changed to the fields I need:
 * add_filter( ‘wordpresscrm_data_binding_columns’, function( $fields, $postContent,
   $postId ) {
    return array_merge( $fields, [ ‘productid’, ‘productnumber’, ‘name’,‘
   description’, ‘oea_subject’ ] ); }, 10, 3 );
 * When referencing the entity binding line in my child theme template file:
 * $currentRecord = ACRM()->binding->getEntity();
 * It throws an error:
 * Fatal error: Uncaught Error: Call to a member function getEntity() on null in/
   home/beta7327/public_html/wp-content/themes/vantage-child/functions.php
 * Do I need to pass something into that getEntity function like the guid?
 * Thank you for the assistance.
    Joe

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [wizardist](https://wordpress.org/support/users/wizardist/)
 * (@wizardist)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/entity-binding-in-php-code/#post-11170316)
 * Hi [@okayaelectric](https://wordpress.org/support/users/okayaelectric/)
 * `wordpresscrm_data_binding_columns` filter is pretty much deprecated.
 * The right way to access binding is by calling `ACRM()->getBinding()->getEntity()`.
 * If you’re getting a non-NULL value, you can access `productid`, `name`, `description`
   and other fields right away.
 * Thanks

Viewing 1 replies (of 1 total)

The topic ‘Entity binding in PHP code’ is closed to new replies.

 * ![](https://ps.w.org/integration-dynamics/assets/icon-256x256.png?rev=1589904)
 * [Dynamics 365 Integration](https://wordpress.org/plugins/integration-dynamics/)
 * [Support Threads](https://wordpress.org/support/plugin/integration-dynamics/)
 * [Active Topics](https://wordpress.org/support/plugin/integration-dynamics/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/integration-dynamics/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/integration-dynamics/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [wizardist](https://wordpress.org/support/users/wizardist/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/entity-binding-in-php-code/#post-11170316)
 * Status: resolved