Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
646 B
1
Indexable
Never
private function verifySort($sort){
        $array = $this->getAttributes(new Performance());
        
        if(isset($array[$sort])){
            return $sort;
        }
        return null;
    }
    
    private function getAttributes($model){
        $columns = $model->getFillable();
        $attributes = $model->getAttributes();
        $add = array_merge(array_flip($columns), $attributes);
        /*foreach ($columns as $column)
        {
            if (!array_key_exists($column, $attributes))
            {
                $attributes[$column] = null;
            }
        }*/
        $add['id'] = null;
        return $add;
    }