original_string: public function findOrInit($conditions = false, $data = array())
      {
          if (!$this->find($conditions)) {
              // Reset status when record not found
              $this->isNew = true;
  
              !is_array($conditions) && $conditions = array($this->primaryKey => $conditions);
  
              // Convert to object to array
              if (is_object($data) && method_exists($data, 'toArray')) {
                  $data = $data->toArray();
              }
  
              // conditions data are fillable
              $this->fromArray($data);
              $this->setData($conditions);
          }
          return $this;
      }
code: public function findOrInit($conditions = false, $data = array())
      {
          if (!$this->find($conditions)) {
              // Reset status when record not found
              $this->isNew = true;
  
              !is_array($conditions) && $conditions = array($this->primaryKey => $conditions);
  
              // Convert to object to array
              if (is_object($data) && method_exists($data, 'toArray')) {
                  $data = $data->toArray();
              }
  
              // conditions data are fillable
              $this->fromArray($data);
              $this->setData($conditions);
          }
          return $this;
      }
code_tokens: public function findOrInit ( $ conditions = false , $ data = array ( ) ) { if ( ! $ this -> find ( $ conditions ) ) { // Reset status when record not found $ this -> isNew = true ; ! is_array ( $ conditions ) && $ conditions = array ( $ this -> primaryKey => $ conditions ) ; // Convert to object to array if ( is_object ( $ data ) && method_exists ( $ data , 'toArray' ) ) { $ data = $ data -> toArray ( ) ; } // conditions data are fillable $ this -> fromArray ( $ data ) ; $ this -> setData ( $ conditions ) ; } return $ this ; }
docstring: Find a record by specified conditions and init with the specified data if record not found
  
  @param mixed $conditions
  @param array $data
  @return $this
docstring_tokens: Find a record by specified conditions and init with the specified data if record not found