Newscoop\Entity\User::getDataTableView PHP Method

getDataTableView() public method

Get DataTable view
public getDataTableView ( Zend_View_Abstract $view ) : object
$view Zend_View_Abstract
return object
    public function getDataTableView(Zend_View_Abstract $view)
    {
        $types = array();
        foreach ($this->getUserTypes() as $type) {
            $types[] = $type->getName();
        }
        switch ($this->status) {
            case '0':
                $status = 'Inactive';
                break;
            case '1':
                $status = 'Active';
                break;
            case '2':
                $status = 'Banned';
                break;
            case '3':
                $status = 'Deleted';
                break;
        }
        return (object) array('id' => $this->id, 'u' => $this->username ?: sprintf('<%s>', preg_replace('/@.*$/', '', $this->email)), 'f' => $this->first_name, 'l' => $this->last_name, 'e' => $this->email, 'g' => $types, 's' => $status, 'c' => $this->created->format('Y-m-d h:i:s'), 'up' => $this->updated->format('Y-m-d h:i:s'), 've' => (bool) (!$this->isPending()) ? 'Yes' : 'No');
    }