Created
May 5, 2014 13:39
-
-
Save ahmad-moussawi/d924e3570a3af8b3b183 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class News extends Eloquent{ | |
public function scopeLang($query) | |
{ | |
return $query->where('LocalString.lang', LANG); | |
} | |
public function Title() | |
{ | |
return $this->belongsTo('LocalString', 'ls_title'); | |
} | |
public function Description(){ | |
return $this->belongsTo('LocalString', 'ls_description'); | |
} | |
} | |
/** | |
select * from News | |
join localstring on ls_title = localstring.primarykey | |
join localstring on ls_description = localstring.primarykey | |
where localstring.langid = EN | |
where id = 5; | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment