本文整理汇总了PHP中yii\db\ActiveRecord::afterFind方法的典型用法代码示例。如果您正苦于以下问题:PHP ActiveRecord::afterFind方法的具体用法?PHP ActiveRecord::afterFind怎么用?PHP ActiveRecord::afterFind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\db\ActiveRecord
的用法示例。
在下文中一共展示了ActiveRecord::afterFind方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: afterFind
public function afterFind()
{
if (strpos($this->email_recipient, ',')) {
$this->email_recipient = implode(',', json_decode($this->email_recipient));
}
return parent::afterFind();
}
示例2: afterFind
public function afterFind()
{
parent::afterFind();
if ($this->linkdata) {
$this->linkdata = iconv('cp949', 'utf-8//IGNORE', $this->linkdata);
}
if ($this->linkdata2) {
$this->linkdata2 = iconv('cp949', 'utf-8//IGNORE', $this->linkdata2);
}
if ($this->filedata1) {
$this->filedata1 = iconv('cp949', 'utf-8//IGNORE', $this->filedata1);
}
if ($this->jungjungdata) {
$this->jungjungdata = iconv('cp949', 'utf-8//IGNORE', $this->jungjungdata);
}
if ($this->maincontents) {
$this->maincontents = iconv('cp949', 'utf-8//IGNORE', $this->maincontents);
}
if ($this->urlinfo1) {
$this->urlinfo1 = iconv('cp949', 'utf-8//IGNORE', $this->urlinfo1);
}
if ($this->urlinfo2) {
$this->urlinfo2 = iconv('cp949', 'utf-8//IGNORE', $this->urlinfo2);
}
if ($this->openbid_contents) {
$this->openbid_contents = iconv('cp949', 'utf-8//IGNORE', $this->openbid_contents);
}
}
示例3: afterFind
public function afterFind()
{
parent::afterFind();
$this->configuration = self::loadConfig($this->config);
$this->getTests();
$this->checkLogging();
}
示例4: afterFind
/**
* @inheritdoc
*/
public function afterFind()
{
parent::afterFind();
if (empty($this->description)) {
$this->description = Inflector::camel2words($this->name, true);
}
}
示例5: afterFind
public function afterFind()
{
parent::afterFind();
if ($this->constno) {
$this->constno = iconv('cp949', 'utf-8', $this->constno);
}
if ($this->refno) {
$this->refno = iconv('cp949', 'utf-8', $this->refno);
}
if ($this->realorg) {
$this->realorg = iconv('cp949', 'utf-8', $this->realorg);
}
if ($this->charger) {
$this->charger = iconv('cp949', 'utf-8', $this->charger);
}
if ($this->bidperm) {
$this->bidperm = iconv('cp949', 'utf-8', $this->bidperm);
}
if ($this->bidqorg) {
$this->bidqorg = iconv('cp949', 'utf-8', $this->bidqorg);
}
if ($this->origin_lnk) {
$this->origin_lnk = iconv('cp949', 'utf-8', $this->origin_lnk);
}
if ($this->attchd_lnk) {
$this->attchd_lnk = iconv('cp949', 'utf-8', $this->attchd_lnk);
}
if ($this->perm) {
$this->perm = iconv('cp949', 'utf-8', $this->perm);
}
}
示例6: afterFind
public function afterFind()
{
if ($this->getNgRestCallType() == 'list') {
$this->trigger(self::EVENT_AFTER_NGREST_FIND);
}
return parent::afterFind();
}
示例7: afterFind
public function afterFind()
{
parent::afterFind();
$scheme = static::getTableSchema();
foreach ($scheme->columns as $column) {
if (static::isSpatial($column)) {
$field = $column->name;
$attr = $this->getAttribute($field);
// get WKT
if ($attr) {
if (YII_DEBUG && preg_match('/[\\x80-\\xff]+/', $attr)) {
/* If you get an exception here, it probably means you have overridden find()
and did not return sjaakp\spatial\ActiveQuery. */
throw new InvalidCallException('Spatial attribute not converted.');
}
$geom = SpatialHelper::wktToGeom($attr);
// Transform geometry FeatureCollection...
if ($geom['type'] == 'GeometryCollection') {
$feats = [];
foreach ($geom['geometries'] as $g) {
$feats[] = ['type' => 'Feature', 'geometry' => $g, 'properties' => $this->featureProperties($field, $g)];
}
$feature = ['type' => 'FeatureCollection', 'features' => $feats];
} else {
// ... or to Feature
$feature = SpatialHelper::geomToFeature($geom, $this->featureProperties($field, $geom));
}
$this->setAttribute($field, Json::encode($feature));
}
}
}
}
示例8: afterFind
public function afterFind()
{
parent::afterFind();
if ($this->hasAttribute("created_at")) {
$this->created_at = \Yii::$app->formatter->asRelativeTime($this->created_at);
}
}
示例9: afterFind
public function afterFind()
{
$this->name = $this->object->name;
$this->loadTags();
$this->determineAccess();
return parent::afterFind();
}
示例10: afterFind
public function afterFind()
{
parent::afterFind();
if ($this->name) {
$this->name = iconv('euckr', 'utf-8', $this->name);
}
}
示例11: afterFind
public function afterFind()
{
parent::afterFind();
if ($this->gname) {
$this->gname = iconv('cp949', 'utf-8', $this->gname);
}
if ($this->gorg) {
$this->gorg = iconv('cp949', 'utf-8', $this->gorg);
}
if ($this->standard) {
$this->standard = iconv('cp949', 'utf-8', $this->standard);
}
if ($this->unit) {
$this->unit = iconv('cp949', 'utf-8', $this->unit);
}
if ($this->unitcost) {
$this->unitcost = iconv('cp949', 'utf-8', $this->unitcost);
}
if ($this->period) {
$this->period = iconv('cp949', 'utf-8', $this->period);
}
if ($this->place) {
$this->place = iconv('cp949', 'utf-8', $this->place);
}
if ($this->condition) {
$this->condition = iconv('cp949', 'utf-8', $this->condition);
}
}
示例12: afterFind
public function afterFind()
{
parent::afterFind();
if ($this->g2bname) {
$this->g2bname = iconv('cp949', 'utf-8', $this->g2bname);
}
}
示例13: afterFind
public function afterFind()
{
parent::afterFind();
if ($this->realorg) {
$this->realorg = iconv('cp949', 'utf-8', $this->realorg);
}
}
示例14: afterFind
public function afterFind()
{
parent::afterFind();
if ($this->g2b_code_nm) {
$this->g2b_code_nm = iconv('euckr', 'utf-8', $this->g2b_code_nm);
}
}
示例15: afterFind
public function afterFind()
{
parent::afterFind();
$empresasUsuarios = EmpresasUsuarios::findAll(['usuario_id' => $this->id]);
$this->empresa_id = \yii\helpers\ArrayHelper::getColumn($empresasUsuarios, 'empresa_id');
$this->user_role = \yii\helpers\ArrayHelper::getColumn(Yii::$app->authManager->getRolesByUser($this->id), 'name');
}