/** * {@inheritdoc} */ public function getCountTransUnitByDomains() { $results = TransUnitQuery::create()->withColumn('count(TransUnit.ID)', 'number')->select(array('number', 'TransUnit.Domain'))->groupBy('TransUnit.Domain')->find(); $counts = array(); foreach ($results as $row) { $counts[$row['TransUnit.Domain']] = (int) $row['number']; } return $counts; }
/** * {@inheritdoc} */ public function getTransUnitByKeyAndDomain($key, $domain) { $key = mb_substr($key, 0, 255, 'UTF-8'); $fields = array('Key' => $key, 'Domain' => $domain); return TransUnitQuery::create()->findOneByArray($fields, $this->getConnection()); }