lib/private/Comments/Comment.php
/**
	 * sets the comment data based on an array with keys as taken from the
	 * database.
	 *
	 * @param array $data
	 * @return IComment
	 */
sets the comment data based on an array with keys as taken from the
database.

@param array $data
@return IComment
sets the comment data based on an array with keys as taken from the database . @param array $data @return IComment
protected function fromArray($data) {
		foreach(array_keys($data) as $key) {
			$setter = 'set' . implode('', array_map('ucfirst', explode('_', $key)));
			$setter = str_replace('Timestamp', 'DateTime', $setter);
			if(method_exists($this, $setter)) {
				$this->$setter($data[$key]);
			}
		}
		foreach(['actor', 'object'] as $role) {
			if(isset($data[$role . '_type']) && isset($data[$role . '_id'])) {
				$setter = 'set' . ucfirst($role);
				$this->$setter($data[$role . '_type'], $data[$role . '_id']);
			}
		}
		return $this;
	}
protected function fromArray ( $ data ) { foreach ( array_keys ( $ data ) as $ key ) { $ setter = 'set' . implode ( '' , array_map ( 'ucfirst' , explode ( '_' , $ key ) ) ) ; $ setter = str_replace ( 'Timestamp' , 'DateTime' , $ setter ) ; if ( method_exists ( $ this , $ setter ) ) { $ this -> $ setter ( $ data [ $ key ] ) ; } } foreach ( [ 'actor' , 'object' ] as $ role ) { if ( isset ( $ data [ $ role . '_type' ] ) && isset ( $ data [ $ role . '_id' ] ) ) { $ setter = 'set' . ucfirst ( $ role ) ; $ this -> $ setter ( $ data [ $ role . '_type' ] , $ data [ $ role . '_id' ] ) ; } } return $ this ; }
sets the comment data based on an array with keys as taken from the
 database.
sets the comment data based on an array with keys as taken from the database .
// translate DB keys to internal setter names