Вход Регистрация
Файл: system/vendor/illuminate/database/Eloquent/Concerns/HidesAttributes.php
Строк: 59
<?php

namespace IlluminateDatabaseEloquentConcerns;

trait 
HidesAttributes
{
    
/**
     * The attributes that should be hidden for serialization.
     *
     * @var array
     */
    
protected $hidden = [];

    
/**
     * The attributes that should be visible in serialization.
     *
     * @var array
     */
    
protected $visible = [];

    
/**
     * Get the hidden attributes for the model.
     *
     * @return array
     */
    
public function getHidden()
    {
        return 
$this->hidden;
    }

    
/**
     * Set the hidden attributes for the model.
     *
     * @param  array  $hidden
     * @return $this
     */
    
public function setHidden(array $hidden)
    {
        
$this->hidden $hidden;

        return 
$this;
    }

    
/**
     * Get the visible attributes for the model.
     *
     * @return array
     */
    
public function getVisible()
    {
        return 
$this->visible;
    }

    
/**
     * Set the visible attributes for the model.
     *
     * @param  array  $visible
     * @return $this
     */
    
public function setVisible(array $visible)
    {
        
$this->visible $visible;

        return 
$this;
    }

    
/**
     * Make the given, typically hidden, attributes visible.
     *
     * @param  array|string|null  $attributes
     * @return $this
     */
    
public function makeVisible($attributes)
    {
        
$attributes is_array($attributes) ? $attributes func_get_args();

        
$this->hidden array_diff($this->hidden$attributes);

        if (! empty(
$this->visible)) {
            
$this->visible array_merge($this->visible$attributes);
        }

        return 
$this;
    }

    
/**
     * Make the given, typically visible, attributes hidden.
     *
     * @param  array|string|null  $attributes
     * @return $this
     */
    
public function makeHidden($attributes)
    {
        
$this->hidden array_merge(
            
$this->hiddenis_array($attributes) ? $attributes func_get_args()
        );

        return 
$this;
    }
}
Онлайн: 0
Реклама