Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Entity.php
Go to the documentation of this file.
1 <?php
7 
14 {
20  protected function _construct()
21  {
22  $this->_init('rating_entity', 'entity_id');
23  }
24 
31  public function getIdByCode($entityCode)
32  {
33  $connection = $this->getConnection();
34 
35  $select = $connection->select()->from(
36  $this->getTable('rating_entity'),
37  $this->getIdFieldName()
38  )->where(
39  'entity_code = :entity_code'
40  );
41  return $connection->fetchOne($select, [':entity_code' => $entityCode]);
42  }
43 }
$connection
Definition: bulk.php:13