!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/home/ccl/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Relations/   drwxrwxr-x
Free 13.12 GB of 57.97 GB (22.63%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     EmbedsOne.php (3.29 KB)      -rw-rw-r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php namespace Jenssegers\Mongodb\Relations;

use 
Illuminate\Database\Eloquent\Model;
use 
MongoId;

class 
EmbedsOne extends EmbedsOneOrMany
{
    
/**
     * Get the results of the relationship.
     *
     * @return \Illuminate\Database\Eloquent\Model
     */
    
public function getResults()
    {
        return 
$this->toModel($this->getEmbedded());
    }

    
/**
     * Save a new model and attach it to the parent model.
     *
     * @param  \Illuminate\Database\Eloquent\Model  $model
     * @return \Illuminate\Database\Eloquent\Model
     */
    
public function performInsert(Model $model)
    {
        
// Generate a new key if needed.
        
if ($model->getKeyName() == '_id' and ! $model->getKey()) {
            
$model->setAttribute('_id', new MongoId);
        }

        
// For deeply nested documents, let the parent handle the changes.
        
if ($this->isNested()) {
            
$this->associate($model);

            return 
$this->parent->save();
        }

        
$result $this->getBaseQuery()->update([$this->localKey => $model->getAttributes()]);

        
// Attach the model to its parent.
        
if ($result) {
            
$this->associate($model);
        }

        return 
$result $model false;
    }

    
/**
     * Save an existing model and attach it to the parent model.
     *
     * @param  \Illuminate\Database\Eloquent\Model  $model
     * @return \Illuminate\Database\Eloquent\Model|bool
     */
    
public function performUpdate(Model $model)
    {
        if (
$this->isNested()) {
            
$this->associate($model);

            return 
$this->parent->save();
        }

        
// Use array dot notation for better update behavior.
        
$values array_dot($model->getDirty(), $this->localKey '.');

        
$result $this->getBaseQuery()->update($values);

        
// Attach the model to its parent.
        
if ($result) {
            
$this->associate($model);
        }

        return 
$result $model false;
    }

    
/**
     * Delete an existing model and detach it from the parent model.
     *
     * @param  \Illuminate\Database\Eloquent\Model  $model
     * @return int
     */
    
public function performDelete(Model $model)
    {
        
// For deeply nested documents, let the parent handle the changes.
        
if ($this->isNested()) {
            
$this->dissociate($model);

            return 
$this->parent->save();
        }

        
// Overwrite the local key with an empty array.
        
$result $this->getBaseQuery()->update([$this->localKey => null]);

        
// Detach the model from its parent.
        
if ($result) {
            
$this->dissociate();
        }

        return 
$result;
    }

    
/**
     * Attach the model to its parent.
     *
     * @param  \Illuminate\Database\Eloquent\Model  $model
     * @return \Illuminate\Database\Eloquent\Model
     */
    
public function associate(Model $model)
    {
        return 
$this->setEmbedded($model->getAttributes());
    }

    
/**
     * Detach the model from its parent.
     *
     * @return \Illuminate\Database\Eloquent\Model
     */
    
public function dissociate()
    {
        return 
$this->setEmbedded(null);
    }

    
/**
     * Delete all embedded models.
     *
     * @return int
     */
    
public function delete()
    {
        
$model $this->getResults();

        return 
$this->performDelete($model);
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0056 ]--