コード例 #1
0
 /**
  * {@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;
 }
コード例 #2
0
 /**
  * {@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());
 }