Guest User

model

a guest
Dec 22nd, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3.  
  4. class facebook_accounts_model extends MY_Model {
  5. public function __construct(){
  6. parent::__construct();
  7. }
  8.  
  9. public function getAccounts(){
  10. $accounts = $this->model->fetch("*", FACEBOOK_ACCOUNTS, getDatabyUser(0), "id", "asc");
  11. if(!empty($accounts)){
  12. foreach ($accounts as $key => $row) {
  13. $user = $this->model->get("*", USER_MANAGEMENT, "id = '".$row->uid."'");
  14. if(!empty($user)){
  15. $accounts[$key]->user = $user->fullname;
  16. }else{
  17. $accounts[$key]->user = "";
  18. }
  19. }
  20. }
  21.  
  22. return $accounts;
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment